diff options
author | unknown <evgen@moonbone.local> | 2006-07-18 21:30:26 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2006-07-18 21:30:26 +0400 |
commit | 5a77e566abb4c486a296c1ad762ddfe740db695e (patch) | |
tree | b8a1526d2ca7f9d2334ece2ae6b2a748a2f19444 /mysql-test | |
parent | e71cf7c457d63640fed0200a6169761eb08655c9 (diff) | |
parent | 76215977850defe766718d483a2ecf9204b1413f (diff) | |
download | mariadb-git-5a77e566abb4c486a296c1ad762ddfe740db695e.tar.gz |
Merge moonbone.local:/work/mysql-4.1
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
mysql-test/r/date_formats.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/date_formats.result | 6 | ||||
-rw-r--r-- | mysql-test/r/mysql_client.result | 4 | ||||
-rw-r--r-- | mysql-test/t/date_formats.test | 8 | ||||
-rw-r--r-- | mysql-test/t/mysql_client.test | 29 |
4 files changed, 46 insertions, 1 deletions
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 00335d2b1b0..035d98d2b74 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -525,3 +525,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 362f4614464..922d047eac8 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -289,7 +289,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 @@ -312,3 +311,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 |