File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ PHP NEWS
2929- MySQLnd:
3030 . Fixed bug GH-8978 (SSL certificate verification fails (port doubled)).
3131 (nielsdos)
32+ . Fixed bug GH-20122 (getColumnMeta() for JSON-column in MySQL). (nielsdos)
3233
3334- Opcache:
3435 . Fixed bug GH-20081 (access to uninitialized vars in preload_load()).
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ require_once 'skipifconnectfailure.inc';
9494 MYSQLI_TYPE_NEWDATE => 'MYSQLI_TYPE_NEWDATE - TODO add testing ' ,
9595 MYSQLI_TYPE_INTERVAL => 'MYSQLI_TYPE_INTERVAL - TODO add testing ' ,
9696 MYSQLI_TYPE_GEOMETRY => 'MYSQLI_TYPE_GEOMETRY - TODO add testing ' ,
97+ MYSQLI_TYPE_JSON => array ('JSON ' , '[] ' ),
9798 );
9899
99100 $ datatypes [MYSQLI_TYPE_NEWDECIMAL ] = array ('DECIMAL ' , '1.1 ' );
Original file line number Diff line number Diff line change @@ -748,6 +748,12 @@ static char *type_to_name_native(int type) /* {{{ */
748748 PDO_MYSQL_NATIVE_TYPE_NAME (DATE )
749749#ifdef FIELD_TYPE_NEWDATE
750750 PDO_MYSQL_NATIVE_TYPE_NAME (NEWDATE )
751+ #endif
752+ #ifdef FIELD_TYPE_VECTOR
753+ PDO_MYSQL_NATIVE_TYPE_NAME (VECTOR )
754+ #endif
755+ #ifdef FIELD_TYPE_JSON
756+ PDO_MYSQL_NATIVE_TYPE_NAME (JSON )
751757#endif
752758 PDO_MYSQL_NATIVE_TYPE_NAME (TIME )
753759 PDO_MYSQL_NATIVE_TYPE_NAME (DATETIME )
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-20122 (getColumnMeta() for JSON-column in MySQL)
3+ --EXTENSIONS--
4+ pdo
5+ pdo_mysql
6+ --SKIPIF--
7+ <?php
8+ require __DIR__ . '/config.inc ' ;
9+ require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc ' ;
10+ PDOTest::skip ();
11+ ?>
12+ --FILE--
13+ <?php
14+ require __DIR__ . '/config.inc ' ;
15+ require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc ' ;
16+ $ db = PDOTest::test_factory (__DIR__ . '/common.phpt ' );
17+
18+ $ db ->exec ('CREATE TABLE test (bar JSON) ' );
19+ $ db ->exec ('INSERT INTO test VALUES("[]") ' );
20+
21+ $ stmt = $ db ->query ('SELECT * from test ' );
22+ $ meta = $ stmt ->getColumnMeta (0 );
23+
24+ // Note: JSON is an alias for LONGTEXT on MariaDB!
25+ echo $ meta ['native_type ' ], "\n" ;
26+ ?>
27+ --CLEAN--
28+ <?php
29+ require __DIR__ . '/mysql_pdo_test.inc ' ;
30+ MySQLPDOTest::dropTestTable ();
31+ ?>
32+ --EXPECTF--
33+ %r(JSON|LONGTEXT)%r
You can’t perform that action at this time.
0 commit comments