Wait, you can still use mysql ext with PHP 8? I thought we got rid of
it once and for all in PHP 7.0. What is the motivation of keeping that
extension alive with PHP 8? Who is testing for the compatibility?
Could you share some information on how to compile MySQL ext against
PHP 8?

On Tue, 15 Dec 2020 at 21:00, Dmitry Stogov <dmitrysto...@gmail.com> wrote:
>
> Hi Nikita,
>
> ext/mysql is not a part of the main php source tree, but it still works and
> is still useful.
> Why do you kill it and why silently (may be I missed discussion)?
> What is the motivation?
>
> Thanks. Dmitry.
>
>
> On Tue, Dec 15, 2020 at 12:58 PM Nikita Popov <ni...@php.net> wrote:
>
> > Commit:    362c29241db872cf7eb030cef1148d47d3489be1
> > Author:    Nikita Popov <nikita....@gmail.com>         Tue, 15 Dec 2020
> > 10:55:53 +0100
> > Parents:   be4f73f328f7aa85f1c893247b5007ce44445f2c
> > Branches:  master
> >
> > Link:
> > http://git.php.net/?p=php-src.git;a=commitdiff;h=362c29241db872cf7eb030cef1148d47d3489be1
> >
> > Log:
> > Remove mysqlnd_extension enum
> >
> > ext/mysql is no longer supported, drop handling for it from
> > mysqlnd.
> >
> > Changed paths:
> >   M  ext/mysqli/mysqli.c
> >   M  ext/mysqli/mysqli_warning.c
> >   M  ext/mysqlnd/mysqlnd.h
> >   M  ext/mysqlnd/mysqlnd_enum_n_def.h
> >   M  ext/mysqlnd/mysqlnd_result.c
> >   M  ext/mysqlnd/mysqlnd_structs.h
> >
> >
> > Diff:
> > diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
> > index cea4ba63946..50c5038f157 100644
> > --- a/ext/mysqli/mysqli.c
> > +++ b/ext/mysqli/mysqli.c
> > @@ -1130,7 +1130,7 @@ void php_mysqli_fetch_into_hash_aux(zval
> > *return_value, MYSQL_RES * result, zend
> >                 }
> >         }
> >  #else
> > -       mysqlnd_fetch_into(result, ((fetchtype & MYSQLI_NUM)?
> > MYSQLND_FETCH_NUM:0) | ((fetchtype & MYSQLI_ASSOC)? MYSQLND_FETCH_ASSOC:0),
> > return_value, MYSQLND_MYSQLI);
> > +       mysqlnd_fetch_into(result, ((fetchtype & MYSQLI_NUM)?
> > MYSQLND_FETCH_NUM:0) | ((fetchtype & MYSQLI_ASSOC)? MYSQLND_FETCH_ASSOC:0),
> > return_value);
> >  #endif
> >  }
> >  /* }}} */
> > diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
> > index 7b1552e5ace..6dd7090911e 100644
> > --- a/ext/mysqli/mysqli_warning.c
> > +++ b/ext/mysqli/mysqli_warning.c
> > @@ -131,7 +131,7 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA *
> > mysql)
> >                 zval *entry;
> >                 int errno;
> >
> > -               mysqlnd_fetch_into(result, MYSQLND_FETCH_NUM, &row,
> > MYSQLND_MYSQLI);
> > +               mysqlnd_fetch_into(result, MYSQLND_FETCH_NUM, &row);
> >                 if (Z_TYPE(row) != IS_ARRAY) {
> >                         zval_ptr_dtor(&row);
> >                         break;
> > diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h
> > index bf3a9d640fa..b4d3d1f8c33 100644
> > --- a/ext/mysqlnd/mysqlnd.h
> > +++ b/ext/mysqlnd/mysqlnd.h
> > @@ -98,7 +98,7 @@ PHPAPI MYSQLND * mysqlnd_connection_connect(MYSQLND *
> > conn,
> >  PHPAPI void mysqlnd_debug(const char *mode);
> >
> >  /* Query */
> > -#define mysqlnd_fetch_into(result, flags, ret_val, ext)
> > (result)->m.fetch_into((result), (flags), (ret_val), (ext)
> > ZEND_FILE_LINE_CC)
> > +#define mysqlnd_fetch_into(result, flags, ret_val)
> >  (result)->m.fetch_into((result), (flags), (ret_val) ZEND_FILE_LINE_CC)
> >  #define mysqlnd_fetch_row_c(result)
> >       (result)->m.fetch_row_c((result))
> >  #define mysqlnd_fetch_all(result, flags, return_value)
> > (result)->m.fetch_all((result), (flags), (return_value) ZEND_FILE_LINE_CC)
> >  #define mysqlnd_get_connection_stats(conn, values)
> >  ((conn)->data)->m->get_statistics((conn)->data,  (values)
> > ZEND_FILE_LINE_CC)
> > diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h
> > b/ext/mysqlnd/mysqlnd_enum_n_def.h
> > index 161a3821bd2..191b8388b34 100644
> > --- a/ext/mysqlnd/mysqlnd_enum_n_def.h
> > +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h
> > @@ -148,12 +148,6 @@
> >  #define TRANS_COR_RELEASE              4
> >  #define TRANS_COR_NO_RELEASE   8
> >
> > -typedef enum mysqlnd_extension
> > -{
> > -       MYSQLND_MYSQL = 0,
> > -       MYSQLND_MYSQLI
> > -} enum_mysqlnd_extension;
> > -
> >  enum
> >  {
> >         MYSQLND_FETCH_ASSOC = 1,
> > diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
> > index bdeefd5d04d..f67f8bdcc17 100644
> > --- a/ext/mysqlnd/mysqlnd_result.c
> > +++ b/ext/mysqlnd/mysqlnd_result.c
> > @@ -1692,8 +1692,7 @@ MYSQLND_METHOD(mysqlnd_res, field_tell)(const
> > MYSQLND_RES * const result)
> >  /* {{{ mysqlnd_res::fetch_into */
> >  static void
> >  MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const
> > unsigned int flags,
> > -
> >      zval *return_value,
> > -
> >      enum_mysqlnd_extension extension ZEND_FILE_LINE_DC)
> > +
> >      zval *return_value ZEND_FILE_LINE_DC)
> >  {
> >         zend_bool fetched_anything;
> >         unsigned int array_size;
> > @@ -1715,15 +1714,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES
> > * result, const unsigned int
> >                 RETVAL_FALSE;
> >         } else if (fetched_anything == FALSE) {
> >                 zend_array_destroy(Z_ARR_P(return_value));
> > -               switch (extension) {
> > -                       case MYSQLND_MYSQLI:
> > -                               RETVAL_NULL();
> > -                               break;
> > -                       case MYSQLND_MYSQL:
> > -                               RETVAL_FALSE;
> > -                               break;
> > -                       default:exit(0);
> > -               }
> > +               RETVAL_NULL();
> >         }
> >         /*
> >           return_value is IS_NULL for no more data and an array for data.
> > Thus it's ok
> > @@ -1778,7 +1769,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES *
> > result, const unsigned int
> >         array_init_size(return_value, set? (unsigned int) set->row_count :
> > 4);
> >
> >         do {
> > -               mysqlnd_fetch_into(result, flags, &row, MYSQLND_MYSQLI);
> > +               mysqlnd_fetch_into(result, flags, &row);
> >                 if (Z_TYPE(row) != IS_ARRAY) {
> >                         zval_ptr_dtor_nogc(&row);
> >                         break;
> > diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
> > index f8562432aee..f992f70baf4 100644
> > --- a/ext/mysqlnd/mysqlnd_structs.h
> > +++ b/ext/mysqlnd/mysqlnd_structs.h
> > @@ -641,7 +641,7 @@ typedef enum_func_status
> > (*func_mysqlnd_res__row_decoder)(MYSQLND_ROW_BUFFER * r
> >
> >  typedef MYSQLND_RES *
> > (*func_mysqlnd_res__use_result)(MYSQLND_RES * const result, const zend_bool
> > ps_protocol);
> >  typedef MYSQLND_RES *
> > (*func_mysqlnd_res__store_result)(MYSQLND_RES * result, MYSQLND_CONN_DATA *
> > const conn, const unsigned int flags);
> > -typedef void
> >  (*func_mysqlnd_res__fetch_into)(MYSQLND_RES *result, const unsigned int
> > flags, zval *return_value, enum_mysqlnd_extension ext ZEND_FILE_LINE_DC);
> > +typedef void
> >  (*func_mysqlnd_res__fetch_into)(MYSQLND_RES *result, const unsigned int
> > flags, zval *return_value ZEND_FILE_LINE_DC);
> >  typedef MYSQLND_ROW_C
> > (*func_mysqlnd_res__fetch_row_c)(MYSQLND_RES *result);
> >  typedef void
> >  (*func_mysqlnd_res__fetch_all)(MYSQLND_RES *result, const unsigned int
> > flags, zval *return_value ZEND_FILE_LINE_DC);
> >  typedef uint64_t
> >  (*func_mysqlnd_res__num_rows)(const MYSQLND_RES * const result);
> >
> >
> > --
> > PHP CVS Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to