@@ -43,8 +43,6 @@ struct st_mysqlnd_time
4343};
4444
4545
46- struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions [MYSQL_TYPE_LAST + 1 ];
47-
4846#define MYSQLND_PS_SKIP_RESULT_W_LEN -1
4947#define MYSQLND_PS_SKIP_RESULT_STR -2
5048
@@ -420,127 +418,37 @@ ps_fetch_bit(zval * zv, const MYSQLND_FIELD * const field, const unsigned int pa
420418/* }}} */
421419
422420
423- /* {{{ _mysqlnd_init_ps_fetch_subsystem */
424- void _mysqlnd_init_ps_fetch_subsystem (void )
425- {
426- memset (mysqlnd_ps_fetch_functions , 0 , sizeof (mysqlnd_ps_fetch_functions ));
427- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NULL ].func = ps_fetch_null ;
428- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NULL ].pack_len = 0 ;
429- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NULL ].php_type = IS_NULL ;
430-
431- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TINY ].func = ps_fetch_int8 ;
432- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TINY ].pack_len = 1 ;
433- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TINY ].php_type = IS_LONG ;
434-
435- mysqlnd_ps_fetch_functions [MYSQL_TYPE_SHORT ].func = ps_fetch_int16 ;
436- mysqlnd_ps_fetch_functions [MYSQL_TYPE_SHORT ].pack_len = 2 ;
437- mysqlnd_ps_fetch_functions [MYSQL_TYPE_SHORT ].php_type = IS_LONG ;
438-
439- mysqlnd_ps_fetch_functions [MYSQL_TYPE_YEAR ].func = ps_fetch_int16 ;
440- mysqlnd_ps_fetch_functions [MYSQL_TYPE_YEAR ].pack_len = 2 ;
441- mysqlnd_ps_fetch_functions [MYSQL_TYPE_YEAR ].php_type = IS_LONG ;
442-
443- mysqlnd_ps_fetch_functions [MYSQL_TYPE_INT24 ].func = ps_fetch_int32 ;
444- mysqlnd_ps_fetch_functions [MYSQL_TYPE_INT24 ].pack_len = 4 ;
445- mysqlnd_ps_fetch_functions [MYSQL_TYPE_INT24 ].php_type = IS_LONG ;
446-
447- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONG ].func = ps_fetch_int32 ;
448- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONG ].pack_len = 4 ;
449- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONG ].php_type = IS_LONG ;
450-
451- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONGLONG ].func = ps_fetch_int64 ;
452- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONGLONG ].pack_len = 8 ;
453- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONGLONG ].php_type = IS_LONG ;
454-
455- mysqlnd_ps_fetch_functions [MYSQL_TYPE_FLOAT ].func = ps_fetch_float ;
456- mysqlnd_ps_fetch_functions [MYSQL_TYPE_FLOAT ].pack_len = 4 ;
457- mysqlnd_ps_fetch_functions [MYSQL_TYPE_FLOAT ].php_type = IS_DOUBLE ;
458-
459- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DOUBLE ].func = ps_fetch_double ;
460- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DOUBLE ].pack_len = 8 ;
461- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DOUBLE ].php_type = IS_DOUBLE ;
462-
463- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TIME ].func = ps_fetch_time ;
464- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TIME ].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN ;
465- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TIME ].php_type = IS_STRING ;
466-
467- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DATE ].func = ps_fetch_date ;
468- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DATE ].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN ;
469- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DATE ].php_type = IS_STRING ;
470-
471- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NEWDATE ].func = ps_fetch_string ;
472- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NEWDATE ].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN ;
473- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NEWDATE ].php_type = IS_STRING ;
474-
475- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DATETIME ].func = ps_fetch_datetime ;
476- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DATETIME ].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN ;
477- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DATETIME ].php_type = IS_STRING ;
478-
479- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TIMESTAMP ].func = ps_fetch_datetime ;
480- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TIMESTAMP ].pack_len = MYSQLND_PS_SKIP_RESULT_W_LEN ;
481- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TIMESTAMP ].php_type = IS_STRING ;
482-
483- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VECTOR ].func = ps_fetch_string ;
484- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VECTOR ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
485- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VECTOR ].php_type = IS_STRING ;
486-
487- mysqlnd_ps_fetch_functions [MYSQL_TYPE_JSON ].func = ps_fetch_string ;
488- mysqlnd_ps_fetch_functions [MYSQL_TYPE_JSON ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
489- mysqlnd_ps_fetch_functions [MYSQL_TYPE_JSON ].php_type = IS_STRING ;
490-
491- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TINY_BLOB ].func = ps_fetch_string ;
492- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TINY_BLOB ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
493- mysqlnd_ps_fetch_functions [MYSQL_TYPE_TINY_BLOB ].php_type = IS_STRING ;
494-
495- mysqlnd_ps_fetch_functions [MYSQL_TYPE_BLOB ].func = ps_fetch_string ;
496- mysqlnd_ps_fetch_functions [MYSQL_TYPE_BLOB ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
497- mysqlnd_ps_fetch_functions [MYSQL_TYPE_BLOB ].php_type = IS_STRING ;
498-
499- mysqlnd_ps_fetch_functions [MYSQL_TYPE_MEDIUM_BLOB ].func = ps_fetch_string ;
500- mysqlnd_ps_fetch_functions [MYSQL_TYPE_MEDIUM_BLOB ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
501- mysqlnd_ps_fetch_functions [MYSQL_TYPE_MEDIUM_BLOB ].php_type = IS_STRING ;
502-
503- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONG_BLOB ].func = ps_fetch_string ;
504- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONG_BLOB ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
505- mysqlnd_ps_fetch_functions [MYSQL_TYPE_LONG_BLOB ].php_type = IS_STRING ;
506-
507- mysqlnd_ps_fetch_functions [MYSQL_TYPE_BIT ].func = ps_fetch_bit ;
508- mysqlnd_ps_fetch_functions [MYSQL_TYPE_BIT ].pack_len = 8 ;
509- mysqlnd_ps_fetch_functions [MYSQL_TYPE_BIT ].php_type = IS_LONG ;
510-
511- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VAR_STRING ].func = ps_fetch_string ;
512- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VAR_STRING ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
513- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VAR_STRING ].php_type = IS_STRING ;
514-
515- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VARCHAR ].func = ps_fetch_string ;
516- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VARCHAR ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
517- mysqlnd_ps_fetch_functions [MYSQL_TYPE_VARCHAR ].php_type = IS_STRING ;
518-
519- mysqlnd_ps_fetch_functions [MYSQL_TYPE_STRING ].func = ps_fetch_string ;
520- mysqlnd_ps_fetch_functions [MYSQL_TYPE_STRING ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
521- mysqlnd_ps_fetch_functions [MYSQL_TYPE_STRING ].php_type = IS_STRING ;
522-
523- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DECIMAL ].func = ps_fetch_string ;
524- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DECIMAL ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
525- mysqlnd_ps_fetch_functions [MYSQL_TYPE_DECIMAL ].php_type = IS_STRING ;
526-
527- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NEWDECIMAL ].func = ps_fetch_string ;
528- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NEWDECIMAL ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
529- mysqlnd_ps_fetch_functions [MYSQL_TYPE_NEWDECIMAL ].php_type = IS_STRING ;
530-
531- mysqlnd_ps_fetch_functions [MYSQL_TYPE_ENUM ].func = ps_fetch_string ;
532- mysqlnd_ps_fetch_functions [MYSQL_TYPE_ENUM ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
533- mysqlnd_ps_fetch_functions [MYSQL_TYPE_ENUM ].php_type = IS_STRING ;
534-
535- mysqlnd_ps_fetch_functions [MYSQL_TYPE_SET ].func = ps_fetch_string ;
536- mysqlnd_ps_fetch_functions [MYSQL_TYPE_SET ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
537- mysqlnd_ps_fetch_functions [MYSQL_TYPE_SET ].php_type = IS_STRING ;
538-
539- mysqlnd_ps_fetch_functions [MYSQL_TYPE_GEOMETRY ].func = ps_fetch_string ;
540- mysqlnd_ps_fetch_functions [MYSQL_TYPE_GEOMETRY ].pack_len = MYSQLND_PS_SKIP_RESULT_STR ;
541- mysqlnd_ps_fetch_functions [MYSQL_TYPE_GEOMETRY ].php_type = IS_STRING ;
542- }
543- /* }}} */
421+ const struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions [MYSQL_TYPE_LAST + 1 ] = {
422+ [MYSQL_TYPE_NULL ] = { ps_fetch_null , 0 , IS_NULL },
423+ [MYSQL_TYPE_TINY ] = { ps_fetch_int8 , 1 , IS_LONG },
424+ [MYSQL_TYPE_SHORT ] = { ps_fetch_int16 , 2 , IS_LONG },
425+ [MYSQL_TYPE_YEAR ] = { ps_fetch_int16 , 2 , IS_LONG },
426+ [MYSQL_TYPE_INT24 ] = { ps_fetch_int32 , 4 , IS_LONG },
427+ [MYSQL_TYPE_LONG ] = { ps_fetch_int32 , 4 , IS_LONG },
428+ [MYSQL_TYPE_LONGLONG ] = { ps_fetch_int64 , 8 , IS_LONG },
429+ [MYSQL_TYPE_FLOAT ] = { ps_fetch_float , 4 , IS_DOUBLE },
430+ [MYSQL_TYPE_DOUBLE ] = { ps_fetch_double , 8 , IS_DOUBLE },
431+ [MYSQL_TYPE_TIME ] = { ps_fetch_time , MYSQLND_PS_SKIP_RESULT_W_LEN , IS_STRING },
432+ [MYSQL_TYPE_DATE ] = { ps_fetch_date , MYSQLND_PS_SKIP_RESULT_W_LEN , IS_STRING },
433+ [MYSQL_TYPE_NEWDATE ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_W_LEN , IS_STRING },
434+ [MYSQL_TYPE_DATETIME ] = { ps_fetch_datetime , MYSQLND_PS_SKIP_RESULT_W_LEN , IS_STRING },
435+ [MYSQL_TYPE_TIMESTAMP ] = { ps_fetch_datetime , MYSQLND_PS_SKIP_RESULT_W_LEN , IS_STRING },
436+ [MYSQL_TYPE_VECTOR ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
437+ [MYSQL_TYPE_JSON ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
438+ [MYSQL_TYPE_TINY_BLOB ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
439+ [MYSQL_TYPE_BLOB ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
440+ [MYSQL_TYPE_MEDIUM_BLOB ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
441+ [MYSQL_TYPE_LONG_BLOB ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
442+ [MYSQL_TYPE_BIT ] = { ps_fetch_bit , 8 , IS_LONG },
443+ [MYSQL_TYPE_VAR_STRING ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
444+ [MYSQL_TYPE_VARCHAR ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
445+ [MYSQL_TYPE_STRING ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
446+ [MYSQL_TYPE_DECIMAL ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
447+ [MYSQL_TYPE_NEWDECIMAL ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
448+ [MYSQL_TYPE_ENUM ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
449+ [MYSQL_TYPE_SET ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
450+ [MYSQL_TYPE_GEOMETRY ] = { ps_fetch_string , MYSQLND_PS_SKIP_RESULT_STR , IS_STRING },
451+ };
544452
545453
546454/* {{{ mysqlnd_stmt_copy_it */
0 commit comments