~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

Viewing changes to mysql-test/t/mysqltest.test

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), remaining changes:
  - debian/mysql-server-5.1.config:
    + ask for MySQL root password at priority high instead of medium so
      that the password prompt is seen on a default install. (LP: #319843)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
# This test uses chmod, can't be run with root permissions
7
7
-- source include/not_as_root.inc
8
8
 
 
9
# Save the initial number of concurrent sessions
 
10
--source include/count_sessions.inc
 
11
 
9
12
# ============================================================================
10
13
#
11
14
# Test of mysqltest itself
50
53
 
51
54
# ----------------------------------------------------------------------------
52
55
# Negative case(statement):
53
 
# The derived table t1 does not contain a column named 'friedrich' . 
 
56
# The derived table t1 does not contain a column named 'friedrich' .
54
57
# --> ERROR 42S22: Unknown column 'friedrich' in 'field list and
55
58
# --> 1054: Unknown column 'friedrich' in 'field list'
56
59
# ----------------------------------------------------------------------------
62
65
--exec echo "select friedrich from (select 1 as otto) as t1;" | $MYSQL_TEST  2>&1
63
66
 
64
67
# expectation = response
65
 
--error 1054
 
68
--error ER_BAD_FIELD_ERROR
 
69
 
66
70
select friedrich from (select 1 as otto) as t1;
67
71
 
68
72
# The following unmasked unsuccessful statement must give
120
124
# $mysql_errno is a builtin variable of mysqltest and contains the return code
121
125
# of the last command sent to the server.
122
126
#
123
 
#      The following test cases often initialize $mysql_errno to 1064 by 
 
127
#      The following test cases often initialize $mysql_errno to 1064 by
124
128
#      a command with wrong syntax.
125
129
#      Example: --error 1064      To prevent the abort after the error.
126
130
#               garbage ;
135
139
#----------------------------------------------------------------------------
136
140
# check mysql_errno = 1064 after statement with wrong syntax
137
141
# ----------------------------------------------------------------------------
138
 
--error 1064
 
142
--error ER_PARSE_ERROR
 
143
 
139
144
garbage ;
140
145
eval select $mysql_errno as "after_wrong_syntax_errno" ;
141
146
 
142
147
# ----------------------------------------------------------------------------
143
148
# check if let $my_var= 'abc' ; affects $mysql_errno
144
149
# ----------------------------------------------------------------------------
145
 
--error 1064
 
150
--error ER_PARSE_ERROR
 
151
 
146
152
garbage ;
147
153
let $my_var= 'abc' ;
148
154
eval select $mysql_errno as "after_let_var_equal_value" ;
150
156
# ----------------------------------------------------------------------------
151
157
# check if set @my_var= 'abc' ; affects $mysql_errno
152
158
# ----------------------------------------------------------------------------
153
 
--error 1064
 
159
--error ER_PARSE_ERROR
 
160
 
154
161
garbage ;
155
162
set @my_var= 'abc' ;
156
163
eval select $mysql_errno as "after_set_var_equal_value" ;
159
166
#  check if the setting of --disable-warnings itself affects $mysql_errno
160
167
#  (May be --<whatever> modifies $mysql_errno.)
161
168
# ----------------------------------------------------------------------------
162
 
--error 1064
 
169
--error ER_PARSE_ERROR
 
170
 
163
171
garbage ;
164
172
--disable_warnings
165
173
eval select $mysql_errno as "after_disable_warnings_command" ;
170
178
# (May be disabled warnings affect $mysql_errno.)
171
179
# ----------------------------------------------------------------------------
172
180
drop table if exists t1 ;
173
 
--error 1064
 
181
--error ER_PARSE_ERROR
 
182
 
174
183
garbage ;
175
184
drop table if exists t1 ;
176
185
eval select $mysql_errno as "after_disable_warnings" ;
179
188
# ----------------------------------------------------------------------------
180
189
# check if masked errors affect $mysql_errno
181
190
# ----------------------------------------------------------------------------
182
 
--error 1064
 
191
--error ER_PARSE_ERROR
 
192
 
183
193
garbage ;
184
 
--error 1146
 
194
--error ER_NO_SUCH_TABLE
 
195
 
185
196
select 3 from t1 ;
186
197
eval select $mysql_errno as "after_minus_masked" ;
187
 
--error 1064
 
198
--error ER_PARSE_ERROR
 
199
 
188
200
garbage ;
189
 
--error 1146
 
201
--error ER_NO_SUCH_TABLE
 
202
 
190
203
select 3 from t1 ;
191
204
eval select $mysql_errno as "after_!_masked" ;
192
205
 
193
206
# ----------------------------------------------------------------------------
194
207
# Will manipulations of $mysql_errno be possible and visible ?
195
208
# ----------------------------------------------------------------------------
196
 
--error 1064
 
209
--error ER_PARSE_ERROR
 
210
 
197
211
garbage ;
198
212
let $mysql_errno= -1;
199
213
eval select $mysql_errno as "after_let_errno_equal_value" ;
202
216
# How affect actions on prepared statements $mysql_errno ?
203
217
# ----------------------------------------------------------------------------
204
218
# failing prepare
205
 
--error 1064
 
219
--error ER_PARSE_ERROR
 
220
 
206
221
garbage ;
207
 
--error 1146
 
222
--error ER_NO_SUCH_TABLE
 
223
 
208
224
prepare stmt from "select 3 from t1" ;
209
225
eval select $mysql_errno as "after_failing_prepare" ;
210
226
create table t1 ( f1 char(10));
211
227
 
212
228
# successful prepare
213
 
--error 1064
 
229
--error ER_PARSE_ERROR
 
230
 
214
231
garbage ;
215
232
prepare stmt from "select 3 from t1" ;
216
233
eval select $mysql_errno as "after_successful_prepare" ;
217
234
 
218
235
# successful execute
219
 
--error 1064
 
236
--error ER_PARSE_ERROR
 
237
 
220
238
garbage ;
221
239
execute stmt;
222
240
eval select $mysql_errno as "after_successful_execute" ;
223
241
 
224
242
# failing execute (table has been dropped)
225
243
drop table t1;
226
 
--error 1064
 
244
--error ER_PARSE_ERROR
 
245
 
227
246
garbage ;
228
 
--error 1146
 
247
--error ER_NO_SUCH_TABLE
 
248
 
229
249
execute stmt;
230
250
eval select $mysql_errno as "after_failing_execute" ;
231
251
 
232
252
# failing execute (unknown statement)
233
 
--error 1064
 
253
--error ER_PARSE_ERROR
 
254
 
234
255
garbage ;
235
 
--error 1243
 
256
--error ER_UNKNOWN_STMT_HANDLER
 
257
 
236
258
execute __stmt_;
237
259
eval select $mysql_errno as "after_failing_execute" ;
238
260
 
239
261
# successful deallocate
240
 
--error 1064
 
262
--error ER_PARSE_ERROR
 
263
 
241
264
garbage ;
242
265
deallocate prepare stmt;
243
266
eval select $mysql_errno as "after_successful_deallocate" ;
244
267
 
245
268
# failing deallocate ( statement handle does not exist )
246
 
--error 1064
 
269
--error ER_PARSE_ERROR
 
270
 
247
271
garbage ;
248
 
--error 1243
 
272
--error ER_UNKNOWN_STMT_HANDLER
 
273
 
249
274
deallocate prepare __stmt_;
250
275
eval select $mysql_errno as "after_failing_deallocate" ;
251
276
 
270
295
# ----------------------------------------------------------------------------
271
296
# Switch off the abort on error and check the effect on $mysql_errno
272
297
# ----------------------------------------------------------------------------
273
 
--error 1064
 
298
--error ER_PARSE_ERROR
 
299
 
274
300
garbage ;
275
301
--disable_abort_on_error
276
302
eval select $mysql_errno as "after_--disable_abort_on_error" ;
284
310
# masked failing statements
285
311
# ----------------------------------------------------------------------------
286
312
# expected error = response
287
 
--error 1146
 
313
--error ER_NO_SUCH_TABLE
 
314
 
288
315
select 3 from t1 ;
289
 
--error 1146
 
316
--error ER_NO_SUCH_TABLE
 
317
 
290
318
select 3 from t1 ;
291
319
eval select $mysql_errno as "after_!errno_masked_error" ;
292
320
# expected error <> response
300
328
# ----------------------------------------------------------------------------
301
329
# Switch the abort on error on and check the effect on $mysql_errno
302
330
# ----------------------------------------------------------------------------
303
 
--error 1064
 
331
--error ER_PARSE_ERROR
 
332
 
304
333
garbage ;
305
334
--enable_abort_on_error
306
335
eval select $mysql_errno as "after_--enable_abort_on_error" ;
309
338
# masked failing statements
310
339
# ----------------------------------------------------------------------------
311
340
# expected error = response
312
 
--error 1146
 
341
--error ER_NO_SUCH_TABLE
 
342
 
313
343
select 3 from t1 ;
314
344
 
315
345
# ----------------------------------------------------------------------------
458
488
 
459
489
# Allow trailing # comment
460
490
--sleep 1 # Wait for insert delayed to be executed.
461
 
--sleep 1        # Wait for insert delayed to be executed.
 
491
--sleep 1        # Wait for insert delayed to be executed.
462
492
 
463
493
# ----------------------------------------------------------------------------
464
494
# Test error
573
603
 
574
604
# Illegal use of exec
575
605
--error 1
576
 
--exec echo "--exec false" | $MYSQL_TEST 2>&1
577
 
 
578
 
--error 1
579
606
--exec echo "--exec " | $MYSQL_TEST 2>&1
580
607
 
581
608
# ----------------------------------------------------------------------------
683
710
--error 1
684
711
--exec echo "let hi;" | $MYSQL_TEST  2>&1
685
712
 
686
 
# More advanced test for bug#17280
 
713
# More advanced test for Bug#17280
687
714
let $success= 1;
688
715
--echo # Execute: --echo # <whatever> success: \$success
689
716
--echo # <whatever> success: $success
955
982
--exec echo "system;" | $MYSQL_TEST 2>&1
956
983
--error 1
957
984
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
958
 
--error 1
959
 
--exec echo "system false;" | $MYSQL_TEST 2>&1
960
985
 
961
986
--disable_abort_on_error
962
987
system NonExistsinfComamdn 2> /dev/null;
1229
1254
--exec echo "replace_result a;" | $MYSQL_TEST 2>&1
1230
1255
--error 1
1231
1256
--exec echo "replace_result a ;" | $MYSQL_TEST 2>&1
1232
 
--exec echo "replace_result a b; echo OK;" | $MYSQL_TEST 2>&1
 
1257
--exec echo "replace_result a b; echo OK; exit;" | $MYSQL_TEST 2>&1
1233
1258
--error 1
1234
1259
--exec echo "--replace_result a b c" | $MYSQL_TEST 2>&1
1235
1260
--error 1
1293
1318
  dec $i;
1294
1319
}
1295
1320
EOF
1296
 
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1
 
1321
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK; exit;" | $MYSQL_TEST 2>&1
1297
1322
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
1298
1323
 
1299
1324
# Repeat connect/disconnect
1364
1389
 
1365
1390
 
1366
1391
# ----------------------------------------------------------------------------
1367
 
# TODO Test queries, especially their errormessages... so it's easy to debug 
 
1392
# TODO Test queries, especially their errormessages... so it's easy to debug
1368
1393
# new scripts and diagnose errors
1369
1394
# ----------------------------------------------------------------------------
1370
1395
 
1371
1396
# ----------------------------------------------------------------------------
1372
 
# Test bug#12386
 
1397
# Test Bug#12386
1373
1398
# ----------------------------------------------------------------------------
1374
1399
let $num= 2;
1375
1400
while ($num)
1376
1401
{
1377
 
   --error 1064
 
1402
   --error ER_PARSE_ERROR
 
1403
 
1378
1404
   failing_statement;
1379
1405
 
1380
1406
   dec $num;
1384
1410
 
1385
1411
 
1386
1412
#
1387
 
# Bug #10251: Identifiers containing quotes not handled correctly
 
1413
# Bug#10251 Identifiers containing quotes not handled correctly
1388
1414
#
1389
1415
select 1 as `a'b`, 2 as `a"b`;
1390
1416
 
1405
1431
 
1406
1432
# The message contains more then 80 characters on multiple lines
1407
1433
# and is kept between double quotes.
1408
 
let $message= 
 
1434
let $message=
1409
1435
"Here comes a very very long message that
1410
1436
    - is longer then 80 characters    and
1411
1437
    - consists of several lines";
1433
1459
#
1434
1460
# Test zero length result file. Should not pass
1435
1461
#
1436
 
--exec touch $MYSQLTEST_VARDIR/tmp/zero_length_file.result
 
1462
--exec echo '' > $MYSQLTEST_VARDIR/tmp/zero_length_file.result
1437
1463
--exec echo "echo ok;" > $MYSQLTEST_VARDIR/tmp/query.sql
1438
1464
--error 1
1439
1465
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result  > /dev/null 2>&1
1440
1466
 
1441
1467
remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result;
1442
1468
--error 0,1
1443
 
remove_file $MYSQLTEST_VARDIR/log/zero_length_file.reject;
 
1469
remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.reject;
 
1470
--error 0,1
 
1471
remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.log;
1444
1472
--error 0,1
1445
1473
remove_file $MYSQL_TEST_DIR/r/zero_length_file.reject;
1446
1474
 
1464
1492
#--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/result_file.result 2>&1
1465
1493
 
1466
1494
#
1467
 
# Bug #11731 mysqltest in multi-statement queries ignores errors in
1468
 
#            non-1st queries
 
1495
# Bug#11731 mysqltest in multi-statement queries ignores errors in
 
1496
#           non-1st queries
1469
1497
#
1470
1498
 
1471
1499
echo Failing multi statement query;
1486
1514
--error 1
1487
1515
--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1
1488
1516
# The .out file should be non existent
1489
 
--exec test ! -s $MYSQLTEST_VARDIR/tmp/bug11731.out
 
1517
--error 1
 
1518
--file_exists $MYSQLTEST_VARDIR/tmp/bug11731.out
1490
1519
drop table t1;
1491
1520
 
1492
1521
 
1500
1529
--exec echo "select 'select-me';"                     >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
1501
1530
--exec echo "insertz "error query"||||"               >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
1502
1531
--exec echo "delimiter ;||||"                         >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
 
1532
--exec echo "exit;"                                   >> $MYSQLTEST_VARDIR/tmp/bug11731.sql
1503
1533
 
1504
1534
# These two should work since the error is expected
1505
1535
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/bug11731.sql  2>&1
1507
1537
 
1508
1538
--exec $MYSQL_TEST --record -x $MYSQLTEST_VARDIR/tmp/bug11731.sql -R $MYSQLTEST_VARDIR/tmp/bug11731.out 2>&1
1509
1539
# The .out file should exist
1510
 
--exec test -s $MYSQLTEST_VARDIR/tmp/bug11731.out
 
1540
--file_exists $MYSQLTEST_VARDIR/tmp/bug11731.out
1511
1541
drop table t1;
1512
1542
remove_file $MYSQLTEST_VARDIR/tmp/bug11731.out;
1513
1543
remove_file $MYSQLTEST_VARDIR/log/bug11731.log;
1514
1544
remove_file $MYSQLTEST_VARDIR/tmp/bug11731.sql;
1515
1545
 
1516
1546
#
1517
 
# Bug#19890     mysqltest: "query" command is broken
 
1547
# Bug#19890 mysqltest "query" command is broken
1518
1548
#
1519
1549
 
1520
1550
# It should be possible to use the command "query" to force mysqltest to
1521
1551
# send the command to the server although it's a builtin mysqltest command.
1522
 
--error 1064
 
1552
--error ER_PARSE_ERROR
 
1553
 
1523
1554
query sleep;
1524
1555
 
1525
 
--error 1064
 
1556
--error ER_PARSE_ERROR
 
1557
 
1526
1558
--query sleep
1527
1559
 
1528
1560
# Just an empty query command
1529
 
--error 1065
 
1561
--error ER_EMPTY_QUERY
 
1562
 
1530
1563
query ;
1531
1564
 
1532
1565
# test for replace_regex
1537
1570
select "at" as col1, "AT" as col2, "c" as col3;
1538
1571
 
1539
1572
--replace_regex /a/b/ /ct/d/
1540
 
select "a" as col1, "ct" as col2; 
 
1573
select "a" as col1, "ct" as col2;
1541
1574
 
1542
1575
--replace_regex /(strawberry)/raspberry and \1/ /blueberry/blackberry/ /potato/tomato/;
1543
1576
select "strawberry","blueberry","potato";
1555
1588
--error 1
1556
1589
--exec echo "--replace_regex /a b c" | $MYSQL_TEST 2>&1
1557
1590
--error 1
1558
 
--exec echo "replace_regex /a /b c ;" | $MYSQL_TEST 2>&1 
 
1591
--exec echo "replace_regex /a /b c ;" | $MYSQL_TEST 2>&1
1559
1592
 
1560
1593
# REQUIREMENT
1561
1594
#   replace_regex should replace substitutions from left to right in output
1692
1725
--diff_files $MYSQLTEST_VARDIR/tmp/diff1.tmp $MYSQLTEST_VARDIR/tmp/diff4.tmp
1693
1726
--error 1
1694
1727
--diff_files $MYSQLTEST_VARDIR/tmp/diff4.tmp $MYSQLTEST_VARDIR/tmp/diff1.tmp
 
1728
exit;
1695
1729
EOF
1696
1730
 
1697
1731
# Execute the above diffs, and send their output to /dev/null - only
1919
1953
# 8. Ensure that "sorted_result " does not change the semantics of
1920
1954
#    "--error ...." or the protocol output after such an expected failure
1921
1955
--sorted_result
1922
 
--error 1146
 
1956
--error ER_NO_SUCH_TABLE
 
1957
 
1923
1958
SELECT '2' as "my_col1",2 as "my_col2"
1924
1959
UNION
1925
1960
SELECT '1',1 from t2;
1926
1961
 
1927
 
# 9. Ensure that several result formatting options including "sorted_result" 
 
1962
# 9. Ensure that several result formatting options including "sorted_result"
1928
1963
#    - have all an effect
1929
1964
#    - "--sorted_result" does not need to be direct before the statement
1930
1965
#    - Row sorting is applied after modification of the column content
2140
2175
rmdir $MYSQLTEST_VARDIR/tmp/testdir;
2141
2176
 
2142
2177
#
2143
 
# Bug #36041: mysql-test-run doesn't seem to string match 100% effectively
2144
 
# on Windows
 
2178
# Bug#36041 mysql-test-run doesn't seem to string match 100% effectively
 
2179
#           on Windows
2145
2180
#
2146
2181
 
2147
2182
--replace_result c:\\a.txt z
2148
2183
SELECT 'c:\\a.txt' AS col;
2149
2184
 
 
2185
#
 
2186
# Bug#32307 mysqltest - does not detect illegal if syntax
 
2187
#
 
2188
 
 
2189
let $test= 1;
 
2190
if ($test){
 
2191
  echo hej;
 
2192
}
 
2193
 
 
2194
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
 
2195
if ($mysql_errno != 1436)
 
2196
{
 
2197
 echo ^ Should not be allowed!
 
2198
}
 
2199
EOF
 
2200
--error 1
 
2201
--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.sql 2>&1
 
2202
remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql;
 
2203
 
 
2204
 
 
2205
# ----------------------------------------------------------------------------
 
2206
# Test that -- is not allowed as comment, only as mysqltest builtin command
 
2207
# ----------------------------------------------------------------------------
 
2208
 
 
2209
# valid
 
2210
select 1;
 
2211
--query select 1
 
2212
--query -- a comment for the server
 
2213
 
 
2214
# Not valid, "select" is not a mysqltest command
 
2215
--error 1
 
2216
--exec echo "--select 1;" | $MYSQL_TEST 2>&1
 
2217
 
 
2218
 
 
2219
# ----------------------------------------------------------------------------
 
2220
# BUG#35701 please allow test language variables in connection and sync_slave_with_master
 
2221
# Test that "connection $variable" works and that $CURRENT_CONNECTION has the right value.
 
2222
# ----------------------------------------------------------------------------
 
2223
 
 
2224
connect (con1,localhost,root,,);
 
2225
--echo $CURRENT_CONNECTION
 
2226
connect (con2,localhost,root,,);
 
2227
--echo $CURRENT_CONNECTION
 
2228
 
 
2229
connection default;
 
2230
--echo $CURRENT_CONNECTION
 
2231
 
 
2232
connection con1;
 
2233
--echo $CURRENT_CONNECTION
 
2234
 
 
2235
connection con2;
 
2236
--echo $CURRENT_CONNECTION
 
2237
 
 
2238
let $x= con1;
 
2239
let $y= con2;
 
2240
 
 
2241
connection $x;
 
2242
--echo $CURRENT_CONNECTION
 
2243
 
 
2244
connection $y;
 
2245
--echo $CURRENT_CONNECTION
 
2246
 
 
2247
# Disconnect the not selected connection
 
2248
disconnect $x;
 
2249
--echo $CURRENT_CONNECTION
 
2250
 
 
2251
# Disconnect the selected connection
 
2252
disconnect $y;
 
2253
--echo $CURRENT_CONNECTION
 
2254
 
 
2255
 
2150
2256
--echo End of tests
2151
2257
 
 
2258
connection default;
 
2259
# Wait till we reached the initial number of concurrent sessions
 
2260
--source include/wait_until_count_sessions.inc