]> granicus.if.org Git - php/commitdiff
Fixing SQL syntax in this very old test to make it pass with MySQL 6.0
authorUlf Wendel <uw@php.net>
Fri, 28 Dec 2007 15:27:38 +0000 (15:27 +0000)
committerUlf Wendel <uw@php.net>
Fri, 28 Dec 2007 15:27:38 +0000 (15:27 +0000)
ext/mysqli/tests/020.phpt

index ac3434bf5e2fef8bb7c3ee977a60640290d0b41f..4399391abedbffc58a902578f24c68cedb5e3565 100644 (file)
@@ -1,8 +1,8 @@
 --TEST--
 mysqli bind_param/bind_result date
 --SKIPIF--
-<?php 
-require_once('skipif.inc'); 
+<?php
+require_once('skipif.inc');
 require_once('skipifconnectfailure.inc');
 ?>
 --FILE--
@@ -20,13 +20,26 @@ require_once('skipifconnectfailure.inc');
        mysqli_query($link, "SET sql_mode=''");
 
        mysqli_query($link,"DROP TABLE IF EXISTS test_bind_result");
-       mysqli_query($link,"CREATE TABLE test_bind_result(c1 date, c2 time,
+
+       $rc = @mysqli_query($link,"CREATE TABLE test_bind_result(
+               c1 date,
+               c2 time,
                c3 timestamp(14),
                c4 year,
                c5 datetime,
                c6 timestamp(4),
                c7 timestamp(6))");
 
+       if (!$rc)
+               $rc = mysqli_query($link,"CREATE TABLE test_bind_result(
+               c1 date,
+               c2 time,
+               c3 timestamp,
+               c4 year,
+               c5 datetime,
+               c6 timestamp,
+               c7 timestamp)");
+
        $stmt = mysqli_prepare($link, "INSERT INTO test_bind_result VALUES (?,?,?,?,?,?,?)");
        mysqli_bind_param($stmt, "sssssss", $d1, $d2, $d3, $d4, $d5, $d6, $d7);
 
@@ -41,7 +54,7 @@ require_once('skipifconnectfailure.inc');
        mysqli_execute($stmt);
        mysqli_stmt_close($stmt);
 
-       $stmt = mysqli_prepare($link, "SELECT * FROM test_bind_result");
+       $stmt = mysqli_prepare($link, "SELECT c1, c2, c3, c4, c5, c6, c7 FROM test_bind_result");
 
        mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7);