File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1426,6 +1426,27 @@ private function execute_select_statement( WP_Parser_Node $node ): void {
14261426 // seems to erase type information for expressions in the SELECT clause.
14271427 $ this ->last_column_meta = array ();
14281428 for ( $ i = 0 ; $ i < $ stmt ->columnCount (); $ i ++ ) {
1429+ /*
1430+ * Workaround for PHP PDO SQLite bug (#79664) in PHP < 7.3.
1431+ * See also: https://github.com/php/php-src/pull/5654
1432+ */
1433+ if ( PHP_VERSION_ID < 70300 ) {
1434+ try {
1435+ $ this ->last_column_meta [] = $ stmt ->getColumnMeta ( $ i );
1436+ } catch ( Throwable $ e ) {
1437+ $ this ->last_column_meta [] = array (
1438+ 'native_type ' => 'null ' ,
1439+ 'pdo_type ' => PDO ::PARAM_NULL ,
1440+ 'flags ' => array (),
1441+ 'table ' => '' ,
1442+ 'name ' => '' ,
1443+ 'len ' => -1 ,
1444+ 'precision ' => 0 ,
1445+ );
1446+ }
1447+ continue ;
1448+ }
1449+
14291450 $ this ->last_column_meta [] = $ stmt ->getColumnMeta ( $ i );
14301451 }
14311452
You can’t perform that action at this time.
0 commit comments