Skip to content

Commit a3bddbe

Browse files
author
Chad MILLER
committed
Move test for bug 39559, which uses command-line mysql client
to separate test file that doesn't permit mysqld embedded in mysqltest. Also, fix different comment handling in a incorrect new-to-5.1 test.
1 parent 09d4c1d commit a3bddbe

6 files changed

+85
-75
lines changed

mysql-test/r/parser.result

-49
Original file line numberDiff line numberDiff line change
@@ -616,54 +616,5 @@ SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
616616
a1 a4
617617
DROP TABLE t1, t2, t3;
618618
#
619-
# Bug#39559: dump of stored procedures / functions with C-style
620-
# comment can't be read back
621-
#
622-
+----------+--------+
623-
| expected | result |
624-
+----------+--------+
625-
| 2 | 2 |
626-
+----------+--------+
627-
+----------+--------+
628-
| expected | result |
629-
+----------+--------+
630-
| 1 | 1 |
631-
+----------+--------+
632-
+----------+--------+
633-
| expected | result |
634-
+----------+--------+
635-
| 3 | 3 |
636-
+----------+--------+
637-
+----------+--------+
638-
| expected | result |
639-
+----------+--------+
640-
| 2 | 2 |
641-
+----------+--------+
642-
+----------+--------+
643-
| expected | result |
644-
+----------+--------+
645-
| 7 | 7 |
646-
+----------+--------+
647-
+----------+--------+
648-
| expected | result |
649-
+----------+--------+
650-
| 8 | 8 |
651-
+----------+--------+
652-
+----------+--------+
653-
| expected | result |
654-
+----------+--------+
655-
| 7 | 7 |
656-
+----------+--------+
657-
+----------+--------+
658-
| expected | result |
659-
+----------+--------+
660-
| 4 | 4 |
661-
+----------+--------+
662-
+----------+--------+
663-
| expected | result |
664-
+----------+--------+
665-
| 4 | 4 |
666-
+----------+--------+
667-
#
668619
# End of 5.1 tests
669620
#
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# Bug#39559: dump of stored procedures / functions with C-style
3+
# comment can't be read back
4+
#
5+
+----------+--------+
6+
| expected | result |
7+
+----------+--------+
8+
| 2 | 2 |
9+
+----------+--------+
10+
+----------+--------+
11+
| expected | result |
12+
+----------+--------+
13+
| 1 | 1 |
14+
+----------+--------+
15+
+----------+--------+
16+
| expected | result |
17+
+----------+--------+
18+
| 3 | 3 |
19+
+----------+--------+
20+
+----------+--------+
21+
| expected | result |
22+
+----------+--------+
23+
| 2 | 2 |
24+
+----------+--------+
25+
+----------+--------+
26+
| expected | result |
27+
+----------+--------+
28+
| 7 | 7 |
29+
+----------+--------+
30+
+----------+--------+
31+
| expected | result |
32+
+----------+--------+
33+
| 8 | 8 |
34+
+----------+--------+
35+
+----------+--------+
36+
| expected | result |
37+
+----------+--------+
38+
| 7 | 7 |
39+
+----------+--------+
40+
+----------+--------+
41+
| expected | result |
42+
+----------+--------+
43+
| 4 | 4 |
44+
+----------+--------+
45+
+----------+--------+
46+
| expected | result |
47+
+----------+--------+
48+
| 4 | 4 |
49+
+----------+--------+

mysql-test/r/partition_mgm.result

+8-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ CREATE TABLE t1 (a INT)
5353
of multi-line
5454
comment */
5555
PARTITIONS 5 */;
56-
ERROR 42000: 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 6
56+
SHOW CREATE TABLE t1;
57+
Table Create Table
58+
t1 CREATE TABLE `t1` (
59+
`a` int(11) DEFAULT NULL
60+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
61+
/*!50100 PARTITION BY HASH (a)
62+
PARTITIONS 5 */
63+
DROP TABLE t1;
5764
CREATE TABLE t1 (a INT)
5865
/*!50100 PARTITION BY HASH (a)
5966
-- with a single line comment embedded

mysql-test/t/parser.test

-24
Original file line numberDiff line numberDiff line change
@@ -725,30 +725,6 @@ UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
725725
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
726726
DROP TABLE t1, t2, t3;
727727

728-
###########################################################################
729-
--echo #
730-
--echo # Bug#39559: dump of stored procedures / functions with C-style
731-
--echo # comment can't be read back
732-
--echo #
733-
734-
--write_file $MYSQLTEST_VARDIR/tmp/bug39559.sql
735-
select 2 as expected, /*!01000/**/*/ 2 as result;
736-
select 1 as expected, /*!99998/**/*/ 1 as result;
737-
select 3 as expected, /*!01000 1 + */ 2 as result;
738-
select 2 as expected, /*!99990 1 + */ 2 as result;
739-
select 7 as expected, /*!01000 1 + /* 8 + */ 2 + */ 4 as result;
740-
select 8 as expected, /*!99998 1 + /* 2 + */ 4 + */ 8 as result;
741-
select 7 as expected, /*!01000 1 + /*!01000 8 + */ 2 + */ 4 as result;
742-
select 7 as expected, /*!01000 1 + /*!99998 8 + */ 2 + */ 4 as result;
743-
select 4 as expected, /*!99998 1 + /*!99998 8 + */ 2 + */ 4 as result;
744-
select 4 as expected, /*!99998 1 + /*!01000 8 + */ 2 + */ 4 as result;
745-
select 7 as expected, /*!01000 1 + /*!01000 8 + /*!01000 error */ 16 + */ 2 + */ 4 as result;
746-
select 4 as expected, /* 1 + /*!01000 8 + */ 2 + */ 4;
747-
EOF
748-
749-
--exec $MYSQL --comment --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql
750-
--remove_file $MYSQLTEST_VARDIR/tmp/bug39559.sql
751-
752728
--echo #
753729
--echo # End of 5.1 tests
754730
--echo #

mysql-test/t/parser_not_embedded.test

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--source include/not_embedded.inc
2+
3+
###########################################################################
4+
--echo #
5+
--echo # Bug#39559: dump of stored procedures / functions with C-style
6+
--echo # comment can't be read back
7+
--echo #
8+
9+
--write_file $MYSQLTEST_VARDIR/tmp/bug39559.sql
10+
select 2 as expected, /*!01000/**/*/ 2 as result;
11+
select 1 as expected, /*!99998/**/*/ 1 as result;
12+
select 3 as expected, /*!01000 1 + */ 2 as result;
13+
select 2 as expected, /*!99990 1 + */ 2 as result;
14+
select 7 as expected, /*!01000 1 + /* 8 + */ 2 + */ 4 as result;
15+
select 8 as expected, /*!99998 1 + /* 2 + */ 4 + */ 8 as result;
16+
select 7 as expected, /*!01000 1 + /*!01000 8 + */ 2 + */ 4 as result;
17+
select 7 as expected, /*!01000 1 + /*!99998 8 + */ 2 + */ 4 as result;
18+
select 4 as expected, /*!99998 1 + /*!99998 8 + */ 2 + */ 4 as result;
19+
select 4 as expected, /*!99998 1 + /*!01000 8 + */ 2 + */ 4 as result;
20+
select 7 as expected, /*!01000 1 + /*!01000 8 + /*!01000 error */ 16 + */ 2 + */ 4 as result;
21+
select 4 as expected, /* 1 + /*!01000 8 + */ 2 + */ 4;
22+
EOF
23+
24+
--exec $MYSQL --comment --force --table test <$MYSQLTEST_VARDIR/tmp/bug39559.sql
25+
--remove_file $MYSQLTEST_VARDIR/tmp/bug39559.sql
26+

mysql-test/t/partition_mgm.test

+2-1
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,14 @@ drop table t1;
6767
#
6868
# Verification tests for bug#14326
6969
#
70-
--error ER_PARSE_ERROR
7170
CREATE TABLE t1 (a INT)
7271
/*!50100 PARTITION BY HASH (a)
7372
/* Test
7473
of multi-line
7574
comment */
7675
PARTITIONS 5 */;
76+
SHOW CREATE TABLE t1;
77+
DROP TABLE t1;
7778
CREATE TABLE t1 (a INT)
7879
/*!50100 PARTITION BY HASH (a)
7980
-- with a single line comment embedded

0 commit comments

Comments
 (0)