]> granicus.if.org Git - php/commitdiff
Remove checks for old libmysqlclient versions in tests
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 17 Sep 2020 12:58:20 +0000 (14:58 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 17 Sep 2020 13:02:35 +0000 (15:02 +0200)
ext/mysqli/tests/013.phpt
ext/mysqli/tests/067.phpt
ext/mysqli/tests/mysqli_constants.phpt
ext/mysqli/tests/mysqli_fetch_array.phpt
ext/mysqli/tests/mysqli_fetch_array_oo.phpt
ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt
ext/mysqli/tests/mysqli_fetch_field_types.phpt
ext/mysqli/tests/mysqli_stmt_attr_get.phpt
ext/mysqli/tests/mysqli_stmt_attr_set.phpt
ext/mysqli/tests/mysqli_stmt_fetch_bit.phpt
ext/mysqli/tests/mysqli_stmt_get_result_bit.phpt

index 2361622c46fa3701b657d48d20f08bbbe9bd76b8..21cb6a949e873b20a8d4041074ab944ad91f7b61 100644 (file)
@@ -46,9 +46,6 @@ require_once('skipifconnectfailure.inc');
         $test .= ($c[$i] == $d[$i]) ? "1" : "0";
     if ($test == "11111111")
         echo "ok\n";
-    else if ($b_res == FALSE && mysqli_get_client_version() > 40100 && mysqli_get_client_version() < 50000 &&
-                 mysqli_get_server_version($link) > 50000)
-        echo "error (4.1 library with 5.x server)";
     else
         echo "error";
 
index 8698b94c94794f6960c5b12ead170e0392136c5c..1560f76522bfed1b001e8f33602a4244472e9b44 100644 (file)
@@ -9,11 +9,10 @@ function test: nested selects (cursors)
        if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
                die("skip Cannot connect to check required version");
 
-       /* skip cursor test for versions < 50004 */
-       if ((!$IS_MYSQLND && (mysqli_get_client_version() < 50009)) ||
-                       (mysqli_get_server_version($link) < 50009)) {
-                       die(sprintf("skip Client library doesn't support cursors (%s/%s)",
-                                       mysqli_get_client_version(), mysqli_get_server_version($link)));
+       /* skip cursor test for server versions < 50009 */
+       if (mysqli_get_server_version($link) < 50009) {
+                       die(sprintf("skip Server doesn't support cursors (%s)",
+                                       mysqli_get_server_version($link)));
        }
        mysqli_close($link);
 ?>
@@ -32,8 +31,7 @@ function test: nested selects (cursors)
     require_once("connect.inc");
     $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
 
-    if ((!$IS_MYSQLND && mysqli_get_client_version() < 50009) ||
-        (mysqli_get_server_version($mysql) < 50009)) {
+    if (mysqli_get_server_version($mysql) < 50009) {
         /* we really want to skip it... */
         die(var_dump(63));
     }
index b281a9c9c5dea0f81598135eb0b8a97b12753c4f..376dc4f93fe91f8c50f1b1a4d2271f89803e37e3 100644 (file)
@@ -139,9 +139,7 @@ mysqli.allow_local_infile=1
         $expected_constants['MYSQLI_SERVER_QUERY_WAS_SLOW'] = true;
     }
 
-    if ($version >= 50033 || $IS_MYSQLND) {
-        $expected_constants['MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT'] = true;
-    }
+    $expected_constants['MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT'] = true;
     if ($IS_MYSQLND) {
         $expected_constants['MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'] = true;
     }
@@ -151,36 +149,26 @@ mysqli.allow_local_infile=1
         $expected_constants['MYSQLI_SERVER_PUBLIC_KEY'] = true;
     }
 
-    if ($version > 50002) {
-        $expected_constants = array_merge($expected_constants, array(
-            "MYSQLI_TYPE_NEWDECIMAL"   => true,
-            "MYSQLI_TYPE_BIT"                  => true,
-        ));
-    }
+    $expected_constants = array_merge($expected_constants, array(
+        "MYSQLI_TYPE_NEWDECIMAL"       => true,
+        "MYSQLI_TYPE_BIT"                      => true,
+    ));
 
-    if ($version > 50002 || $IS_MYSQLND) {
-        $expected_constants['MYSQLI_NO_DEFAULT_VALUE_FLAG'] = true;
-    }
+    $expected_constants['MYSQLI_NO_DEFAULT_VALUE_FLAG'] = true;
 
-    if ($version > 50003) {
-        $expected_constants = array_merge($expected_constants, array(
-            "MYSQLI_STMT_ATTR_CURSOR_TYPE"             => true,
-            "MYSQLI_CURSOR_TYPE_NO_CURSOR"             => true,
-            "MYSQLI_CURSOR_TYPE_READ_ONLY"             => true,
-            "MYSQLI_CURSOR_TYPE_FOR_UPDATE"            => true,
-            "MYSQLI_CURSOR_TYPE_SCROLLABLE"            => true,
-        ));
-    }
+    $expected_constants = array_merge($expected_constants, array(
+        "MYSQLI_STMT_ATTR_CURSOR_TYPE"         => true,
+        "MYSQLI_CURSOR_TYPE_NO_CURSOR"         => true,
+        "MYSQLI_CURSOR_TYPE_READ_ONLY"         => true,
+        "MYSQLI_CURSOR_TYPE_FOR_UPDATE"                => true,
+        "MYSQLI_CURSOR_TYPE_SCROLLABLE"                => true,
+    ));
 
-    if ($version > 50007) {
-        $expected_constants = array_merge($expected_constants, array(
-            "MYSQLI_STMT_ATTR_PREFETCH_ROWS"   => true,
-        ));
-    }
+    $expected_constants = array_merge($expected_constants, array(
+        "MYSQLI_STMT_ATTR_PREFETCH_ROWS"       => true,
+    ));
 
-    if ($version > 50110 || $IS_MYSQLND) {
-        $expected_constants['MYSQLI_OPT_SSL_VERIFY_SERVER_CERT'] = true;
-    }
+    $expected_constants['MYSQLI_OPT_SSL_VERIFY_SERVER_CERT'] = true;
 
     /* pretty dump test, but that is the best way to mimic mysql.c */
     if (defined('MYSQLI_DATA_TRUNCATED'))
index fe1c6b94cac8a925cbb6066d7d08b200ba4e153c..ce7053cfe14174542eecbed39ba4cf036ebc2f57 100644 (file)
@@ -174,9 +174,7 @@ require_once('skipifconnectfailure.inc');
     func_mysqli_fetch_array($link, $engine, "INTEGER UNSIGNED", "4294967295", "4294967295", 230);
     func_mysqli_fetch_array($link, $engine, "INTEGER UNSIGNED", NULL, NULL, 240);
 
-    if ($IS_MYSQLND ||
-        ((mysqli_get_server_version($link) >= 51000) &&
-        (mysqli_get_client_version($link) >= 51000))) {
+    if ($IS_MYSQLND || mysqli_get_server_version($link) >= 51000) {
         func_mysqli_fetch_array($link, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250);
         func_mysqli_fetch_array($link, $engine, "BIGINT", NULL, NULL, 260);
         func_mysqli_fetch_array($link, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 260);
index 616be43e8b110699c75c906320ecb604452b0013..4ef3281203703cd223ba788c1a0a5e41912ed950 100644 (file)
@@ -169,9 +169,7 @@ require_once('skipifconnectfailure.inc');
     func_mysqli_fetch_array($mysqli, $engine, "INTEGER UNSIGNED", "4294967295", "4294967295", 230);
     func_mysqli_fetch_array($mysqli, $engine, "INTEGER UNSIGNED", NULL, NULL, 240);
 
-    if ($IS_MYSQLND ||
-        ((mysqli_get_server_version($link) >= 51000) &&
-         (mysqli_get_client_version($link) >= 51000))) {
+    if ($IS_MYSQLND || mysqli_get_server_version($link) >= 51000) {
         func_mysqli_fetch_array($mysqli, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250);
         func_mysqli_fetch_array($mysqli, $engine, "BIGINT", NULL, NULL, 260);
         func_mysqli_fetch_array($mysqli, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 270);
index 60c635995a2b310dae67d5f0fa1839cf95f5065b..1116c38d45905b0649eb25423c213a7ab4be3776 100644 (file)
@@ -11,9 +11,6 @@ mysqli_fetch_assoc() - BIT
        if (mysqli_get_server_version($link) < 50003)
                // b'001' syntax not supported before 5.0.3
                die("skip Syntax used for test not supported with MySQL Server before 5.0.3");
-       if (!$IS_MYSQLND && (mysqli_get_client_version() < 50003))
-               // better don't trust libmysql before 5.0.3
-               die("skip Syntax used for test not supported with MySQL Server before 5.0.3");
 ?>
 --FILE--
 <?php
index ae21349ab091a9cb77dce9263db256007d4daa22..70152212e370f0a53759c8848625dc9fc12eadd6 100644 (file)
@@ -96,18 +96,8 @@ require_once('skipifconnectfailure.inc');
         MYSQLI_TYPE_GEOMETRY => 'MYSQLI_TYPE_GEOMETRY - TODO add testing',
     );
 
-    if ($IS_MYSQLND) {
-        $version = 50007 + 1;
-    } else {
-        $version = mysqli_get_client_version();
-    }
-
-    if ($version > 50002) {
-        $datatypes[MYSQLI_TYPE_NEWDECIMAL] = array('DECIMAL', '1.1');
-        $datatypes[MYSQLI_TYPE_BIT] = array('BIT', 0);
-    } else {
-        $datatypes[MYSQLI_TYPE_DECIMAL] = array('DECIMAL', '1.1');
-    }
+    $datatypes[MYSQLI_TYPE_NEWDECIMAL] = array('DECIMAL', '1.1');
+    $datatypes[MYSQLI_TYPE_BIT] = array('BIT', 0);
 
     foreach ($datatypes as $php_type => $datatype) {
         if (is_array($datatype))
index 6179155e777b198c099277451c827d010ba4876c..ec3cf3d8d0a5a33492b4e2811188dc25dfd7ad54 100644 (file)
@@ -12,12 +12,11 @@ require_once('skipifconnectfailure.inc');
 
     require('table.inc');
 
-    $valid_attr = array("max_length" => MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH);
-    if (mysqli_get_client_version() > 50003)
-        $valid_attr["cursor_type"] = MYSQLI_STMT_ATTR_CURSOR_TYPE;
-
-    if ($IS_MYSQLND && mysqli_get_client_version() > 50007)
-        $valid_attr["prefetch_rows"] = MYSQLI_STMT_ATTR_PREFETCH_ROWS;
+    $valid_attr = array(
+        "max_length" => MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH,
+        "cursor_type" => MYSQLI_STMT_ATTR_CURSOR_TYPE,
+        "prefetch_rows" => MYSQLI_STMT_ATTR_PREFETCH_ROWS,
+    );
 
     $stmt = mysqli_stmt_init($link);
     mysqli_stmt_prepare($stmt, 'SELECT * FROM test');
index 870960e602f9aa113f0ce19eb162b4ceb6632510..6e4267e6fb054a7dee3c5681fb5bd65ce650e8f3 100644 (file)
@@ -13,16 +13,12 @@ require_once("connect.inc");
     require('table.inc');
 
     $valid_attr = array(MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH);
-    if ((mysqli_get_client_version() > 50003) || $IS_MYSQLND) {
-        $valid_attr[] = MYSQLI_STMT_ATTR_CURSOR_TYPE;
-        $valid_attr[] =        MYSQLI_CURSOR_TYPE_NO_CURSOR;
-        $valid_attr[] =        MYSQLI_CURSOR_TYPE_READ_ONLY;
-        $valid_attr[] =        MYSQLI_CURSOR_TYPE_FOR_UPDATE;
-        $valid_attr[] =        MYSQLI_CURSOR_TYPE_SCROLLABLE;
-    }
-
-    if ((mysqli_get_client_version() > 50007) || $IS_MYSQLND)
-        $valid_attr[] = MYSQLI_STMT_ATTR_PREFETCH_ROWS;
+    $valid_attr[] = MYSQLI_STMT_ATTR_CURSOR_TYPE;
+    $valid_attr[] =    MYSQLI_CURSOR_TYPE_NO_CURSOR;
+    $valid_attr[] =    MYSQLI_CURSOR_TYPE_READ_ONLY;
+    $valid_attr[] =    MYSQLI_CURSOR_TYPE_FOR_UPDATE;
+    $valid_attr[] =    MYSQLI_CURSOR_TYPE_SCROLLABLE;
+    $valid_attr[] = MYSQLI_STMT_ATTR_PREFETCH_ROWS;
 
 
     $stmt = mysqli_stmt_init($link);
@@ -110,78 +106,75 @@ require_once("connect.inc");
     // Cursors
     //
 
-    if (mysqli_get_client_version() > 50003) {
-
-        $stmt = mysqli_stmt_init($link);
-        $stmt->prepare("SELECT id, label FROM test");
 
-        // Invalid cursor type
-        try {
-            $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, -1);
-        } catch (\ValueError $e) {
-            echo $e->getMessage() . \PHP_EOL;
-        }
+    $stmt = mysqli_stmt_init($link);
+    $stmt->prepare("SELECT id, label FROM test");
 
-        if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_FOR_UPDATE)))
-            printf("[011] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
+    // Invalid cursor type
+    try {
+        $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, -1);
+    } catch (\ValueError $e) {
+        echo $e->getMessage() . \PHP_EOL;
+    }
 
-        if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_SCROLLABLE)))
-            printf("[012] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
+    if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_FOR_UPDATE)))
+        printf("[011] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
 
-        if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR)))
-            printf("[013] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
+    if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_SCROLLABLE)))
+        printf("[012] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
 
-        if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY)))
-            printf("[014] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
+    if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR)))
+        printf("[013] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
 
-        $stmt->close();
+    if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY)))
+        printf("[014] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
 
-        $stmt = mysqli_stmt_init($link);
-        $stmt->prepare("SELECT id, label FROM test");
-        $stmt->execute();
-        $id = $label = NULL;
-        $stmt->bind_result($id, $label);
-        $results = array();
-        while ($stmt->fetch())
-            $results[$id] = $label;
-        $stmt->close();
-        if (empty($results))
-            printf("[015] Results should not be empty, subsequent tests will probably fail!\n");
+    $stmt->close();
 
-        $stmt = mysqli_stmt_init($link);
-        $stmt->prepare("SELECT id, label FROM test");
-        if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR)))
-            printf("[016] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
-        $stmt->execute();
-        $id = $label = NULL;
-        $stmt->bind_result($id, $label);
-        $results2 = array();
-        while ($stmt->fetch())
-            $results2[$id] = $label;
-        $stmt->close();
-        if ($results != $results2) {
-            printf("[017] Results should not differ. Dumping both result sets.\n");
-            var_dump($results);
-            var_dump($results2);
-        }
+    $stmt = mysqli_stmt_init($link);
+    $stmt->prepare("SELECT id, label FROM test");
+    $stmt->execute();
+    $id = $label = NULL;
+    $stmt->bind_result($id, $label);
+    $results = array();
+    while ($stmt->fetch())
+        $results[$id] = $label;
+    $stmt->close();
+    if (empty($results))
+        printf("[015] Results should not be empty, subsequent tests will probably fail!\n");
 
-        $stmt = mysqli_stmt_init($link);
-        $stmt->prepare("SELECT id, label FROM test");
-        if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY)))
-            printf("[018] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
-        $stmt->execute();
-        $id = $label = NULL;
-        $stmt->bind_result($id, $label);
-        $results2 = array();
-        while ($stmt->fetch())
-            $results2[$id] = $label;
-        $stmt->close();
-        if ($results != $results2) {
-            printf("[019] Results should not differ. Dumping both result sets.\n");
-            var_dump($results);
-            var_dump($results2);
-        }
+    $stmt = mysqli_stmt_init($link);
+    $stmt->prepare("SELECT id, label FROM test");
+    if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR)))
+        printf("[016] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
+    $stmt->execute();
+    $id = $label = NULL;
+    $stmt->bind_result($id, $label);
+    $results2 = array();
+    while ($stmt->fetch())
+        $results2[$id] = $label;
+    $stmt->close();
+    if ($results != $results2) {
+        printf("[017] Results should not differ. Dumping both result sets.\n");
+        var_dump($results);
+        var_dump($results2);
+    }
 
+    $stmt = mysqli_stmt_init($link);
+    $stmt->prepare("SELECT id, label FROM test");
+    if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_READ_ONLY)))
+        printf("[018] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
+    $stmt->execute();
+    $id = $label = NULL;
+    $stmt->bind_result($id, $label);
+    $results2 = array();
+    while ($stmt->fetch())
+        $results2[$id] = $label;
+    $stmt->close();
+    if ($results != $results2) {
+        printf("[019] Results should not differ. Dumping both result sets.\n");
+        var_dump($results);
+        var_dump($results2);
     }
 
 
@@ -189,61 +182,57 @@ require_once("connect.inc");
     // MYSQLI_STMT_ATTR_PREFETCH_ROWS
     //
 
-    if (mysqli_get_client_version() > 50007) {
-
-        $stmt = mysqli_stmt_init($link);
-        $stmt->prepare("SELECT id, label FROM test");
-        // Invalid prefetch value
-        try {
-            $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 0);
-        } catch (\ValueError $e) {
-            echo $e->getMessage() . \PHP_EOL;
-        }
-
-        if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 1)))
-            printf("[020] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
-        $stmt->execute();
-        $id = $label = NULL;
-        $stmt->bind_result($id, $label);
-        $results = array();
-        while ($stmt->fetch())
-            $results[$id] = $label;
-        $stmt->close();
-        if (empty($results))
-            printf("[021] Results should not be empty, subsequent tests will probably fail!\n");
+    $stmt = mysqli_stmt_init($link);
+    $stmt->prepare("SELECT id, label FROM test");
+    // Invalid prefetch value
+    try {
+        $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 0);
+    } catch (\ValueError $e) {
+        echo $e->getMessage() . \PHP_EOL;
+    }
 
-        /* prefetch is not supported
-        $stmt = mysqli_stmt_init($link);
-        $stmt->prepare("SELECT label FROM test");
-        if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, -1)))
-            printf("[022] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
-        $stmt->close();
+    if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 1)))
+        printf("[020] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
+    $stmt->execute();
+    $id = $label = NULL;
+    $stmt->bind_result($id, $label);
+    $results = array();
+    while ($stmt->fetch())
+        $results[$id] = $label;
+    $stmt->close();
+    if (empty($results))
+        printf("[021] Results should not be empty, subsequent tests will probably fail!\n");
 
-        $stmt = mysqli_stmt_init($link);
-        $stmt->prepare("SELECT label FROM test");
-        if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, PHP_INT_MAX)))
-                printf("[023] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
-        $stmt->close();
+    /* prefetch is not supported
+    $stmt = mysqli_stmt_init($link);
+    $stmt->prepare("SELECT label FROM test");
+    if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, -1)))
+        printf("[022] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
+    $stmt->close();
 
-        $stmt = mysqli_stmt_init($link);
-        $stmt->prepare("SELECT id, label FROM test");
-        if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 2)))
-            printf("[024] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
-        $stmt->execute();
-        $id = $label = NULL;
-        $stmt->bind_result($id, $label);
-        $results2 = array();
-        while ($stmt->fetch())
-            $results2[$id] = $label;
-        $stmt->close();
-        if ($results != $results2) {
-            printf("[025] Results should not differ. Dumping both result sets.\n");
-            var_dump($results);
-            var_dump($results2);
-        }
-        */
+    $stmt = mysqli_stmt_init($link);
+    $stmt->prepare("SELECT label FROM test");
+    if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, PHP_INT_MAX)))
+            printf("[023] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
+    $stmt->close();
 
+    $stmt = mysqli_stmt_init($link);
+    $stmt->prepare("SELECT id, label FROM test");
+    if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_PREFETCH_ROWS, 2)))
+        printf("[024] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
+    $stmt->execute();
+    $id = $label = NULL;
+    $stmt->bind_result($id, $label);
+    $results2 = array();
+    while ($stmt->fetch())
+        $results2[$id] = $label;
+    $stmt->close();
+    if ($results != $results2) {
+        printf("[025] Results should not differ. Dumping both result sets.\n");
+        var_dump($results);
+        var_dump($results2);
     }
+    */
 
     mysqli_close($link);
     print "done!";
index b3c74e4af2fdb74628f024ee42d8c425a405a445..3cbe8e4ee28f455e6b832f3980e9af513c7625d9 100644 (file)
@@ -10,9 +10,6 @@ Fetching BIT column values using the PS API
        if (mysqli_get_server_version($link) < 50003)
                // b'001' syntax not supported before 5.0.3
                die("skip Syntax used for test not supported with MySQL Server before 5.0.3");
-       if (!$IS_MYSQLND && (mysqli_get_client_version() < 50003))
-               // better don't trust libmysql before 5.0.3
-               die("skip Syntax used for test not supported with MySQL Server before 5.0.3");
 ?>
 --FILE--
 <?php
index 7c4292de007a0a032fb9e811808b9665fc93b2f1..e86bde93616186a34e4262add5cae6ca31eb6449 100644 (file)
@@ -14,9 +14,6 @@ Fetching BIT column values using the PS API
        if (mysqli_get_server_version($link) < 50003)
                // b'001' syntax not supported before 5.0.3
                die("skip Syntax used for test not supported with MySQL Server before 5.0.3");
-       if (!$IS_MYSQLND && (mysqli_get_client_version() < 50003))
-               // better don't trust libmysql before 5.0.3
-               die("skip Syntax used for test not supported with MySQL Server before 5.0.3");
 ?>
 --FILE--
 <?php