summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-07-18 21:32:25 +0400
committerunknown <evgen@moonbone.local>2006-07-18 21:32:25 +0400
commitec40f4a588faa4b759816fd619929088b0723c24 (patch)
tree936ba28a1ea1b3a74a7153b6f9de37b6fcc475ef
parent769280a460e85b4ed829de9209e74222872d390a (diff)
parent5a77e566abb4c486a296c1ad762ddfe740db695e (diff)
downloadmariadb-git-ec40f4a588faa4b759816fd619929088b0723c24.tar.gz
Merge moonbone.local:/work/tmp_merge-4.1-opt-mysql
into moonbone.local:/work/tmp_merge-5.0-opt-mysql client/mysql.cc: Auto merged mysql-test/r/date_formats.result: Auto merged mysql-test/t/date_formats.test: Auto merged sql/time.cc: Manual merge
-rw-r--r--client/mysql.cc2
-rw-r--r--mysql-test/r/date_formats.result6
-rw-r--r--mysql-test/r/mysql_client.result4
-rw-r--r--mysql-test/t/date_formats.test8
-rw-r--r--mysql-test/t/mysql_client.test29
5 files changed, 47 insertions, 2 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 6fcda6d766f..bf13170c58e 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1084,7 +1084,7 @@ static int read_and_execute(bool interactive)
(We want to allow help, print and clear anywhere at line start
*/
if ((named_cmds || glob_buffer.is_empty())
- && !in_string && (com=find_command(line,0)))
+ && !ml_comment && !in_string && (com=find_command(line,0)))
{
if ((*com->func)(&glob_buffer,line) > 0)
break;
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 45078800910..08ed5fc6439 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -564,3 +564,9 @@ TIME_FORMAT("24:00:00", '%l %p')
SELECT TIME_FORMAT("25:00:00", '%l %p');
TIME_FORMAT("25:00:00", '%l %p')
1 AM
+SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896);
+DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896)
+NULL
+Warnings:
+Warning 1292 Truncated incorrect datetime value: '%Y-%m-%d %H:%i:%s'
+"End of 4.1 tests"
diff --git a/mysql-test/r/mysql_client.result b/mysql-test/r/mysql_client.result
new file mode 100644
index 00000000000..87d09428ff6
--- /dev/null
+++ b/mysql-test/r/mysql_client.result
@@ -0,0 +1,4 @@
+1
+1
+ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
+ERROR at line 1: USE must be followed by a database name
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index 21c228145ac..a81487d273d 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -290,7 +290,6 @@ drop table t1;
select str_to_date( 1, NULL );
select str_to_date( NULL, 1 );
select str_to_date( 1, IF(1=1,NULL,NULL) );
-# End of 4.1 tests
#
# Bug#11326
@@ -321,3 +320,10 @@ SELECT TIME_FORMAT("12:00:00", '%l %p');
SELECT TIME_FORMAT("23:00:00", '%l %p');
SELECT TIME_FORMAT("24:00:00", '%l %p');
SELECT TIME_FORMAT("25:00:00", '%l %p');
+
+#
+# Bug#20729: Bad date_format() call makes mysql server crash
+#
+SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896);
+
+--echo "End of 4.1 tests"
diff --git a/mysql-test/t/mysql_client.test b/mysql-test/t/mysql_client.test
new file mode 100644
index 00000000000..e4b6658b631
--- /dev/null
+++ b/mysql-test/t/mysql_client.test
@@ -0,0 +1,29 @@
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+
+#
+# Bug #20432: mysql client interprets commands in comments
+#
+
+# if the client sees the 'use' within the comment, we haven't fixed
+--exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec echo "*/" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1
+
+# SQL can have embedded comments => workie
+--exec echo "select /*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec echo "use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec echo "*/ 1" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1
+
+# client commands on the other hand must be at BOL => error
+--exec echo "/*" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec echo "xxx" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec echo "*/ use" >> $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--error 1
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1
+
+# client comment recognized, but parameter missing => error
+--exec echo "use" > $MYSQLTEST_VARDIR/tmp/bug20432.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug20432.sql 2>&1