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

« back to all changes in this revision

Viewing changes to mysql-test/t/show_check.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:
5
5
# depends on the presence of the log tables (which are CSV-based).
6
6
--source include/have_csv.inc
7
7
 
 
8
# Save the initial number of concurrent sessions
 
9
--source include/count_sessions.inc
 
10
 
8
11
#
9
12
# Test of some show commands
10
13
#
195
198
drop table t1;
196
199
 
197
200
#
198
 
# Test for Bug #2593 "SHOW CREATE TABLE doesn't properly double quotes"
 
201
# Test for Bug#2593 SHOW CREATE TABLE doesn't properly double quotes
199
202
#
200
203
 
201
204
SET @old_sql_mode= @@sql_mode, sql_mode= '';
223
226
SHOW CREATE TABLE """a";
224
227
DROP TABLE """a";
225
228
 
226
 
#Bug #4374 SHOW TABLE STATUS FROM ignores collation_connection
 
229
# Bug#4374 SHOW TABLE STATUS FROM ignores collation_connection
227
230
#set names latin1;
228
231
#create database `�`;
229
232
#create table `�`.`�` (a int) engine=heap;
248
251
SET sql_mode= @old_sql_mode;
249
252
 
250
253
#
251
 
# Test for bug #2719 "Heap tables status shows wrong or missing data."
 
254
# Test for Bug#2719 Heap tables status shows wrong or missing data.
252
255
#
253
256
 
254
257
select @@max_heap_table_size;
309
312
drop table t1, t2, t3;
310
313
 
311
314
#
312
 
# Test for bug #3342 SHOW CREATE DATABASE seems to require DROP privilege
 
315
# Test for Bug#3342 SHOW CREATE DATABASE seems to require DROP privilege
313
316
#
314
317
 
315
318
create database mysqltest;
324
327
connection con1;
325
328
select * from t1;
326
329
show create database mysqltest;
327
 
--error 1142
 
330
--error ER_TABLEACCESS_DENIED_ERROR
328
331
drop table t1;
329
 
--error 1044
 
332
--error ER_DBACCESS_DENIED_ERROR
330
333
drop database mysqltest;
 
334
disconnect con1;
331
335
 
332
336
connect (con2,localhost,mysqltest_2,,test);
333
337
connection con2;
334
 
--error 1142
 
338
--error ER_TABLEACCESS_DENIED_ERROR
335
339
select * from mysqltest.t1;
336
 
--error 1044
 
340
--error ER_DBACCESS_DENIED_ERROR
337
341
show create database mysqltest;
338
 
--error 1142
 
342
--error ER_TABLEACCESS_DENIED_ERROR
339
343
drop table mysqltest.t1;
340
 
--error 1044
 
344
--error ER_DBACCESS_DENIED_ERROR
341
345
drop database mysqltest;
 
346
disconnect con2;
342
347
 
343
348
connect (con3,localhost,mysqltest_3,,test);
344
349
connection con3;
345
 
--error 1142
 
350
--error ER_TABLEACCESS_DENIED_ERROR
346
351
select * from mysqltest.t1;
347
352
show create database mysqltest;
348
353
drop table mysqltest.t1;
349
354
drop database mysqltest;
 
355
disconnect con3;
350
356
 
351
357
connection default;
352
358
set names binary;
353
 
delete from mysql.user 
 
359
delete from mysql.user
354
360
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
355
 
delete from mysql.db   
 
361
delete from mysql.db
356
362
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
357
363
flush privileges;
358
364
 
366
372
#drop database `�`;
367
373
 
368
374
# Test that USING <keytype> is always shown in SHOW CREATE TABLE when it was
369
 
# specified during table creation, but not otherwise. (Bug #7235)
 
375
# specified during table creation, but not otherwise. (Bug#7235)
370
376
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
371
377
SHOW CREATE TABLE t1;
372
378
DROP TABLE t1;
397
403
SHOW CREATE TABLE t1;
398
404
DROP TABLE t1;
399
405
 
400
 
# Test for BUG#9439 "Reporting wrong datatype for sub_part on show index"
 
406
# Test for Bug#9439 Reporting wrong datatype for sub_part on show index
401
407
CREATE TABLE t1(
402
408
  field1 text NOT NULL,
403
409
  PRIMARY KEY(field1(1000))
407
413
--disable_metadata
408
414
drop table t1;
409
415
 
410
 
# Test for BUG#11635: mysqldump exports TYPE instead of USING for HASH
 
416
# Test for Bug#11635 mysqldump exports TYPE instead of USING for HASH
411
417
create table t1 (
412
418
  c1 int NOT NULL,
413
419
  c2 int NOT NULL,
417
423
SHOW CREATE TABLE t1;
418
424
DROP TABLE t1;
419
425
 
420
 
# Test for BUG#93: 4.1 protocl crash on corupted frm and SHOW TABLE STATUS
 
426
# Test for Bug#93 4.1 protocl crash on corupted frm and SHOW TABLE STATUS
421
427
 
422
428
flush tables;
423
429
 
424
430
# Create a junk frm file on disk
425
 
system echo "this is a junk file for test" >> $MYSQLTEST_VARDIR/master-data/test/t1.frm ;
 
431
let $MYSQLD_DATADIR= `select @@datadir`;
 
432
system echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ;
426
433
--replace_column 6 # 7 # 8 # 9 #
427
434
SHOW TABLE STATUS like 't1';
428
 
--error 1033
 
435
--error ER_NOT_FORM_FILE
429
436
show create table t1;
430
437
drop table if exists t1;
431
438
--error 1,0
432
 
--remove_file $MYSQLTEST_VARDIR/master-data/test/t1.frm
 
439
--remove_file $MYSQLD_DATADIR/test/t1.frm
433
440
 
434
441
#
435
 
# BUG 12183 -  SHOW OPEN TABLES behavior doesn't match grammar
 
442
# Bug#12183 SHOW OPEN TABLES behavior doesn't match grammar
436
443
# First we close all open tables with FLUSH tables and then we open some.
437
444
#
438
445
 
439
446
--echo
440
 
--echo # Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar.
 
447
--echo # Bug#12183 SHOW OPEN TABLES behavior doesn't match grammar.
441
448
--echo
442
449
 
443
450
# NOTE: SHOW OPEN TABLES does not sort result list by database or table names.
496
503
--echo
497
504
 
498
505
#
499
 
# BUG #12591 (SHOW TABLES FROM dbname produces wrong error message)
 
506
# Bug#12591 SHOW TABLES FROM dbname produces wrong error message
500
507
#
501
 
--error 1049
 
508
--error ER_BAD_DB_ERROR
502
509
SHOW TABLES FROM non_existing_database;
503
510
 
504
511
--echo End of 4.1 tests
505
512
 
506
513
#
507
 
# Bug#17203: "sql_no_cache sql_cache" in views created from prepared
 
514
# Bug#17203 "sql_no_cache sql_cache" in views created from prepared
508
515
# statement
509
516
#
510
517
# The problem was that initial user setting was forgotten, and current
584
591
 
585
592
 
586
593
#
587
 
# Bug #19764: SHOW commands end up in the slow log as table scans
 
594
# Bug#19764 SHOW commands end up in the slow log as table scans
588
595
#
589
596
flush status;
590
597
show status like 'slow_queries';
596
603
show status like 'slow_queries';
597
604
 
598
605
create table t1 (a int);
599
 
create trigger tr1 before insert on t1 for each row 
 
606
create trigger tr1 before insert on t1 for each row
600
607
begin
601
608
end;
602
609
create view v1 as select a from t1;
656
663
drop procedure p1;
657
664
drop function f1;
658
665
drop event e1;
 
666
 
659
667
#
660
 
# BUG#10491: Server returns data as charset binary SHOW CREATE TABLE or SELECT
661
 
# FROM I_S.
 
668
# Bug#10491 Server returns data as charset binary SHOW CREATE TABLE or SELECT
 
669
#           FROM I_S.
662
670
#
663
671
 
664
672
#
773
781
 
774
782
--echo ----------------------------------------------------------------
775
783
 
776
 
SELECT 
 
784
SELECT
777
785
  TRIGGER_CATALOG,
778
786
  TRIGGER_SCHEMA,
779
787
  TRIGGER_NAME,
896
904
# Check:
897
905
#   - Dump mysqltest1;
898
906
 
 
907
--let $outfile1=$MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql
 
908
 
899
909
--echo
900
 
--echo ---> Dumping mysqltest1 to show_check.mysqltest1.sql
 
910
--echo ---> Dumping mysqltest1 to outfile1
901
911
 
902
 
--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql
 
912
--exec $MYSQL_DUMP --default-character-set=latin1 --character-sets-dir=$CHARSETSDIR --databases mysqltest1 > $outfile1
903
913
 
904
914
#   - Clean mysqltest1;
905
915
 
914
924
--echo
915
925
 
916
926
--echo ---> Restoring mysqltest1...
917
 
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/show_check.mysqltest1.sql
 
927
--exec $MYSQL test < $outfile1
 
928
--remove_file $outfile1
918
929
 
919
930
#   - Check definition of the table.
920
931
 
926
937
use test;
927
938
 
928
939
#
929
 
# Bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
 
940
# Bug#28808 log_queries_not_using_indexes variable dynamic change is ignored
930
941
#
931
942
flush status;
932
943
show variables like "log_queries_not_using_indexes";
942
953
show status like 'slow_queries';
943
954
 
944
955
#
945
 
# Bug #30088: Can't disable myisam-recover by a value of ""
 
956
# Bug#30088 Can't disable myisam-recover by a value of ""
946
957
#
947
958
show variables like 'myisam_recover_options';
948
959
 
973
984
--enable_result_log
974
985
 
975
986
#
976
 
# Test for bug #9785 SELECT privilege for the whole database is needed to do SHOW CREATE DATABASE
 
987
# Bug#9785 SELECT privilege for the whole database is needed to do
 
988
#          SHOW CREATE DATABASE
977
989
#
978
990
create database mysqltest;
979
991
show create database mysqltest;
989
1001
delete from mysql.tables_priv where user='mysqltest_4';
990
1002
flush privileges;
991
1003
drop database mysqltest;
 
1004
connection default;
 
1005
disconnect con4;
992
1006
 
993
1007
#
994
1008
# Ensure that show plugin code is tested
1004
1018
--enable_result_log
1005
1019
 
1006
1020
#
1007
 
# Bug #19874: SHOW COLUMNS and SHOW KEYS handle identifiers containing
1008
 
# \ incorrectly
 
1021
# Bug#19874 SHOW COLUMNS and SHOW KEYS handle identifiers containing
 
1022
#           \ incorrectly
1009
1023
#
1010
1024
create database `mysqlttest\1`;
1011
1025
create table `mysqlttest\1`.`a\b` (a int);
1017
1031
drop database `mysqlttest\1`;
1018
1032
 
1019
1033
#
1020
 
# Bug#24392: SHOW ENGINE MUTEX STATUS is a synonym for SHOW INNODB STATUS
 
1034
# Bug#24392 SHOW ENGINE MUTEX STATUS is a synonym for SHOW INNODB STATUS
1021
1035
#
1022
1036
 
1023
1037
--error ER_UNKNOWN_STORAGE_ENGINE
1103
1117
DEALLOCATE PREPARE stmt1;
1104
1118
 
1105
1119
#
1106
 
# BUG#10491: Server returns data as charset binary SHOW CREATE TABLE or SELECT
1107
 
# FROM INFORMATION_SCHEMA.
 
1120
# Bug#10491 Server returns data as charset binary SHOW CREATE TABLE or SELECT
 
1121
#           FROM INFORMATION_SCHEMA.
1108
1122
#
1109
1123
# Before the change performed to fix the bug, the metadata of the output of
1110
1124
# SHOW CREATE statements would always describe the result as 'binary'. That
1167
1181
DROP EVENT ev1;
1168
1182
 
1169
1183
#
1170
 
# Bug #30036: SHOW TABLE TYPES causes the debug client to crash
 
1184
# Bug#30036 SHOW TABLE TYPES causes the debug client to crash
1171
1185
#
1172
1186
--disable_result_log
1173
1187
SHOW TABLE TYPES;
1174
1188
--enable_result_log
1175
1189
 
1176
 
#
1177
 
# Bug #32710: SHOW INNODB STATUS requires SUPER
1178
 
#
1179
1190
 
 
1191
#
 
1192
# Bug#32710 SHOW INNODB STATUS requires SUPER
 
1193
#
1180
1194
 
1181
1195
CREATE USER test_u@localhost;
1182
1196
GRANT PROCESS ON *.* TO test_u@localhost;
1194
1208
 
1195
1209
 
1196
1210
--echo End of 5.1 tests
 
1211
 
 
1212
# Wait till all disconnects are completed
 
1213
--source include/wait_until_count_sessions.inc
 
1214