From: Ulf Wendel Date: Thu, 12 Jul 2007 16:03:10 +0000 (+0000) Subject: Testing SELECT "a" AS "". This is nice to test strcmp() and similar... X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~170 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d649c2e82051dabd50de77ecaafd29e75ed0f026;p=php Testing SELECT "a" AS "". This is nice to test strcmp() and similar... --- diff --git a/ext/mysql/tests/mysql_query.phpt b/ext/mysql/tests/mysql_query.phpt index 185aa1ea8e..9906f99f91 100644 --- a/ext/mysql/tests/mysql_query.phpt +++ b/ext/mysql/tests/mysql_query.phpt @@ -35,6 +35,13 @@ if (!$res = mysql_query('SELECT "this is sql but with semicolon" AS valid ; ', $ var_dump(mysql_fetch_assoc($res)); mysql_free_result($res); +if (!$res = mysql_query('SELECT "a" AS ""', $link)) + printf("[007a] [%d] %s\n", mysql_errno($link), mysql_error($link)); + +var_dump($tmp = mysql_fetch_assoc($res)); +var_dump($tmp[""]); +mysql_free_result($res); + if (false !== ($res = mysql_query('SELECT "this is sql but with semicolon" AS valid ; SHOW VARIABLES', $link))) printf("[008] [%d] %s\n", mysql_errno($link), mysql_error($link)); @@ -87,6 +94,11 @@ array(1) { ["valid"]=> string(30) "this is sql but with semicolon" } +array(1) { + [""]=> + string(1) "a" +} +string(1) "a" Warning: mysql_query(): %d is not a valid MySQL-Link resource in %s on line %d done! @@ -95,6 +107,11 @@ array(1) { [u"valid"]=> unicode(30) "this is sql but with semicolon" } +array(1) { + [u""]=> + unicode(1) "a" +} +unicode(1) "a" Warning: mysql_query(): %d is not a valid MySQL-Link resource in %s on line %d -done! \ No newline at end of file +done!