Skip to content

Commit e5eb7cb

Browse files
author
msvensson@neptunus.(none)
committed
WL#2930 Adding view and cursor 'protocols' to mysqltest
- Cleanup of mysqltest.c before extending it
1 parent b8e755a commit e5eb7cb

14 files changed

+569
-638
lines changed

client/mysqltest.c

+539-608
Large diffs are not rendered by default.

mysql-test/include/master-slave.inc

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ connection slave;
88
--disable_warnings
99
stop slave;
1010
--enable_warnings
11-
@r/slave-stopped.result show status like 'Slave_running';
11+
--require r/slave-stopped.result
12+
show status like 'Slave_running';
1213
connection master;
1314
--disable_warnings
1415
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -21,7 +22,8 @@ reset slave;
2122
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
2223
--enable_warnings
2324
start slave;
24-
@r/slave-running.result show status like 'Slave_running';
25+
--require r/slave-running.result
26+
show status like 'Slave_running';
2527

2628
# Set the default connection to 'master'
2729
connection master;

mysql-test/include/ps_query.inc

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ execute stmt1;
5252

5353
##### parameter used for keyword like SELECT (must fail)
5454
set @arg00='SELECT' ;
55-
# mysqltest gives no output for the next statement, Why ??
5655
--error 1064
5756
@arg00 a from t1 where a=1;
5857
--error 1064

mysql-test/r/mysqltest.result

+3
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ hello
149149
mysqltest: At line 1: End of line junk detected: "6"
150150
mysqltest: At line 1: End of line junk detected: "6"
151151
mysqltest: At line 1: Missing delimiter
152+
mysqltest: End of line junk detected: "sleep 7
153+
# Another comment
154+
"
152155
mysqltest: At line 1: Extra delimiter ";" found
153156
mysqltest: At line 1: Extra delimiter ";" found
154157
MySQL

mysql-test/r/ps_2myisam.result

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
8585
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
8686
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
8787
set @arg00='SELECT' ;
88+
@arg00 a from t1 where a=1;
89+
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 '@arg00 a from t1 where a=1' at line 1
8890
prepare stmt1 from ' ? a from t1 where a=1 ';
8991
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 '? a from t1 where a=1' at line 1
9092
set @arg00=1 ;

mysql-test/r/ps_3innodb.result

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
8585
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
8686
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
8787
set @arg00='SELECT' ;
88+
@arg00 a from t1 where a=1;
89+
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 '@arg00 a from t1 where a=1' at line 1
8890
prepare stmt1 from ' ? a from t1 where a=1 ';
8991
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 '? a from t1 where a=1' at line 1
9092
set @arg00=1 ;

mysql-test/r/ps_4heap.result

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
8686
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
8787
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
8888
set @arg00='SELECT' ;
89+
@arg00 a from t1 where a=1;
90+
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 '@arg00 a from t1 where a=1' at line 1
8991
prepare stmt1 from ' ? a from t1 where a=1 ';
9092
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 '? a from t1 where a=1' at line 1
9193
set @arg00=1 ;

mysql-test/r/ps_5merge.result

+4
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
128128
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
129129
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
130130
set @arg00='SELECT' ;
131+
@arg00 a from t1 where a=1;
132+
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 '@arg00 a from t1 where a=1' at line 1
131133
prepare stmt1 from ' ? a from t1 where a=1 ';
132134
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 '? a from t1 where a=1' at line 1
133135
set @arg00=1 ;
@@ -3140,6 +3142,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
31403142
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
31413143
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
31423144
set @arg00='SELECT' ;
3145+
@arg00 a from t1 where a=1;
3146+
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 '@arg00 a from t1 where a=1' at line 1
31433147
prepare stmt1 from ' ? a from t1 where a=1 ';
31443148
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 '? a from t1 where a=1' at line 1
31453149
set @arg00=1 ;

mysql-test/r/ps_6bdb.result

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
8585
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
8686
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
8787
set @arg00='SELECT' ;
88+
@arg00 a from t1 where a=1;
89+
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 '@arg00 a from t1 where a=1' at line 1
8890
prepare stmt1 from ' ? a from t1 where a=1 ';
8991
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 '? a from t1 where a=1' at line 1
9092
set @arg00=1 ;

mysql-test/r/ps_7ndb.result

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c
8585
1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday
8686
9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday
8787
set @arg00='SELECT' ;
88+
@arg00 a from t1 where a=1;
89+
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 '@arg00 a from t1 where a=1' at line 1
8890
prepare stmt1 from ' ? a from t1 where a=1 ';
8991
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 '? a from t1 where a=1' at line 1
9092
set @arg00=1 ;

mysql-test/t/alias.test

-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05
6161
INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
6262

6363
# This died because we used the field Kundentyp twice
64-
--disable_ps_protocol
6564
SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
66-
--enable_ps_protocol
6765

6866
drop table t1;
6967

mysql-test/t/group_by.test

-4
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,7 @@ drop table t1;
596596

597597
CREATE TABLE t1 (n int);
598598
INSERT INTO t1 VALUES (1);
599-
--disable_ps_protocol
600599
SELECT n+1 AS n FROM t1 GROUP BY n;
601-
--enable_ps_protocol
602600
DROP TABLE t1;
603601

604602
#
@@ -623,11 +621,9 @@ insert into t1 values ('aaa', 'bb1'), ('aaa', 'bb2');
623621
insert into t2 values ('aaa', 'bb1'), ('aaa', 'bb2');
624622

625623
# query with ambiguous column reference 'c2'
626-
--disable_ps_protocol
627624
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4
628625
group by c2;
629626
show warnings;
630-
--enable_ps_protocol
631627

632628
# this query has no ambiguity
633629
select t1.c1 as c2 from t1, t2 where t1.c2 = t2.c4

mysql-test/t/mysqltest.test

+9
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,15 @@ select 3 from t1 ;
364364
--error 1
365365
--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1
366366

367+
#
368+
# Missing delimiter until eof
369+
# The comment will be "sucked into" the sleep command since
370+
# delimiter is missing
371+
--system echo "sleep 7" > var/log/mysqltest.sql
372+
--system echo "# Another comment" >> var/log/mysqltest.sql
373+
--error 1
374+
--exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1
375+
367376
#
368377
# Extra delimiter
369378
#

mysql-test/t/union.test

-21
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
2727
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
2828
explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
2929
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
30-
# PS doesn't work correctly with found_rows: to be fixed
31-
--disable_ps_protocol
3230
select found_rows();
3331
select sql_calc_found_rows a,b from t1 union all select a,b from t2 limit 2;
3432
select found_rows();
35-
--enable_ps_protocol
3633

3734
#
3835
# Test some error conditions with UNION
@@ -210,43 +207,25 @@ insert into t2 values (3),(4),(5);
210207

211208
# Test global limits
212209
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1;
213-
# PS doesn't work correctly with found_rows: to be fixed
214-
--disable_ps_protocol
215210
select found_rows();
216-
--enable_ps_protocol
217211
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2;
218-
# PS doesn't work correctly with found_rows: to be fixed
219-
--disable_ps_protocol
220212
select found_rows();
221-
--enable_ps_protocol
222213

223214
# Test cases where found_rows() should return number of returned rows
224215
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2);
225-
# PS doesn't work correctly with found_rows: to be fixed
226-
--disable_ps_protocol
227216
select found_rows();
228-
--enable_ps_protocol
229217
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1);
230-
# PS doesn't work correctly with found_rows: to be fixed
231-
--disable_ps_protocol
232218
select found_rows();
233-
--enable_ps_protocol
234219
# This used to work in 4.0 but not anymore in 4.1
235220
--error 1064
236221
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
237222
#select found_rows();
238223

239224
# In these case found_rows() should work
240225
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
241-
# PS doesn't work correctly with found_rows: to be fixed
242-
--disable_ps_protocol
243226
select found_rows();
244-
--disable_ps_protocol
245227
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2;
246-
# PS doesn't work correctly with found_rows: to be fixed
247-
--disable_ps_protocol
248228
select found_rows();
249-
--disable_ps_protocol
250229

251230
# The following examples will not be exact
252231
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2;

0 commit comments

Comments
 (0)