]> granicus.if.org Git - php/commitdiff
Fixed test.
authorDmitry Stogov <dmitry@zend.com>
Wed, 7 Oct 2015 11:09:37 +0000 (14:09 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 7 Oct 2015 11:09:37 +0000 (14:09 +0300)
MySQL and MariaDB of different versions have different assumptions about TIMESTAMP attributes.
Probably we need to add yet another condition to also check MariaDB version.

ext/mysqli/tests/mysqli_fetch_field_flags.phpt

index 06b936aeed26caa8402eeeef77369372f7071b9a..e234a28fe5e6af45bb7d850a44bc50d328d0c1f1 100644 (file)
@@ -106,7 +106,10 @@ mysqli_close($link);
        if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
                printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
 
-       if (mysqli_get_server_version($link) > 50600) {
+       $is_maria_db = strpos(mysqli_get_server_info($link), "MariaDB") !== false;
+       if ($is_maria_db) {
+               $columns['TIMESTAMP NOT NULL'] = 'ON_UPDATE_NOW TIMESTAMP BINARY UNSIGNED NOT_NULL';
+       } else if (mysqli_get_server_version($link) > 50600) {
                $columns['TIMESTAMP NOT NULL'] = 'ON_UPDATE_NOW TIMESTAMP BINARY NOT_NULL';
        }