~ubuntu-branches/ubuntu/karmic/mysql-dfsg-5.1/karmic

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-02-10 16:42:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090210164205-ej41ocvm4z1s14nq
Tags: 5.1.31-1ubuntu1
* Merge from debian experimental, 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)
  - debian/control: 
    + Don't build mysql-server, mysql-client, mysql-common and 
      libmysqlclient15-dev binary packages since they're still provided 
      by mysql-dfsg-5.0.
    + Rename libmysqlclient-dev package to libmysqlclient16-dev (LP: #316280).
      Make it conflict with libmysqlclient15-dev.
    + 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.
  - debian/rules: added -fno-strict-aliasing to CFLAGS to get
    around mysql testsuite build failures.
* debian/patches/92_ssl_test_cert.dpatch: certificate expiration in 
  test suite (LP: #323755).
* Dropped changes:
  - all of the changes made to support both 5.0 and 5.1 installed at the
    same time have been dropped now that amarok doesn't depend on
    mysql-server-5.1 anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
--disable_ps_protocol
11
11
use mysql;
12
12
 
 
13
# Capture initial settings of system variables
 
14
# so that we can revert to old state after manipulation for testing
 
15
# NOTE:  PLEASE USE THESE VALUES TO 'RESET' SYSTEM VARIABLES
 
16
# Capturing old values within the tests results in loss of values
 
17
# due to people not paying attention to previous tests' changes, captures
 
18
# or improper cleanup
 
19
SET @saved_long_query_time = @@long_query_time;
 
20
SET @saved_log_output = @@log_output;
 
21
SET @saved_general_log = @@GLOBAL.general_log;
 
22
SET @saved_slow_query_log = @@GLOBAL.slow_query_log;
 
23
 
 
24
SELECT @saved_long_query_time, @saved_log_output, @saved_general_log, @saved_slow_query_log;
 
25
 
 
26
 
 
27
 
13
28
#
14
29
# Check that log tables work and we can do basic selects. This also
15
30
# tests truncate, which works in a special mode with the log tables
161
176
select sleep(2);
162
177
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
163
178
select * from mysql.slow_log;
 
179
set @@session.long_query_time = @saved_long_query_time;
164
180
 
165
181
#
166
182
# Bug #18559 log tables cannot change engine, and gets deadlocked when
305
321
# Bug #21785 Server crashes after rename of the log table
306
322
#
307
323
 
 
324
SET SESSION long_query_time = 1000;
308
325
--disable_warnings
309
326
drop table if exists mysql.renamed_general_log;
310
327
drop table if exists mysql.renamed_slow_log;
365
382
 
366
383
RENAME TABLE general_log2 TO general_log;
367
384
RENAME TABLE slow_log2 TO slow_log;
 
385
SET SESSION long_query_time = @saved_long_query_time;
368
386
 
369
387
# this should work
370
388
set global general_log='ON';
476
494
 
477
495
## test the slow query log
478
496
 
479
 
SET @old_long_query_time:=@@long_query_time;
480
 
 
481
497
SET GLOBAL slow_query_log = 0;
482
498
FLUSH LOGS;
483
499
 
503
519
SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3;
504
520
 
505
521
SET GLOBAL slow_query_log = 0;
506
 
SET SESSION long_query_time =@old_long_query_time;
 
522
SET SESSION long_query_time =@saved_long_query_time;
507
523
FLUSH LOGS;
508
524
 
509
525
ALTER TABLE mysql.slow_log DROP COLUMN seq;
510
526
ALTER TABLE mysql.slow_log ENGINE = CSV;
511
527
 
 
528
SET GLOBAL slow_query_log = @saved_slow_query_log;
 
529
 
512
530
#
513
531
# Bug#25422 (Hang with log tables)
514
532
#
790
808
 
791
809
DELIMITER ;//
792
810
 
793
 
SET @old_general_log_state = @@global.general_log;
794
 
SET @old_slow_log_state = @@global.slow_query_log;
795
 
 
796
811
SET GLOBAL general_log = ON;
797
812
SET GLOBAL slow_query_log = ON;
798
813
 
814
829
DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
815
830
DROP DATABASE IF EXISTS `db_17876`;
816
831
 
817
 
SET GLOBAL general_log = @old_general_log_state;
818
 
SET GLOBAL slow_query_log = @old_slow_log_state;
 
832
SET GLOBAL general_log = @saved_general_log;
 
833
SET GLOBAL slow_query_log = @saved_slow_query_log;
819
834
 
820
835
#
821
836
# Bug#21557 entries in the general query log truncated at 1000 characters.
823
838
 
824
839
select CONNECTION_ID() into @thread_id;
825
840
truncate table mysql.general_log;
826
 
set @old_general_log_state = @@global.general_log;
827
841
set global general_log = on;
828
842
--disable_result_log
829
843
set @lparam = "000 001 002 003 004 005 006 007 008 009"
934
948
set global general_log = off;
935
949
select command_type, argument from mysql.general_log where thread_id = @thread_id;
936
950
deallocate prepare long_query;
937
 
set global general_log = @old_general_log_state;
 
951
set global general_log = @saved_general_log;
938
952
 
939
953
#
940
954
# Bug#34306: Can't make copy of log tables when server binary log is enabled
948
962
 
949
963
CREATE TABLE log_count (count BIGINT(21));
950
964
 
951
 
SET @old_general_log_state = @@global.general_log;
952
 
SET @old_slow_log_state = @@global.slow_query_log;
953
 
 
954
965
SET GLOBAL general_log = ON;
955
966
SET GLOBAL slow_query_log = ON;
956
967
 
977
988
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
978
989
DROP TABLE general_log_copy;
979
990
 
980
 
SET GLOBAL general_log = @old_general_log_state;
981
 
SET GLOBAL slow_query_log = @old_slow_log_state;
 
991
SET GLOBAL general_log = @saved_general_log;
 
992
SET GLOBAL slow_query_log = @saved_slow_query_log;
982
993
 
983
994
DROP TABLE log_count;
984
995
 
985
996
#
986
997
# Bug #31700: thd->examined_row_count not incremented for 'const' type queries
987
998
#
988
 
SET @old_slow_log_state = @@global.slow_query_log;
989
999
 
990
1000
SET SESSION long_query_time = 0;
991
1001
SET GLOBAL slow_query_log = ON;
1010
1020
 
1011
1021
TRUNCATE TABLE mysql.slow_log;
1012
1022
 
1013
 
SET GLOBAL slow_query_log = @old_slow_log_state;
1014
 
SET SESSION long_query_time =@old_long_query_time;
 
1023
# RESET altered system variables before exiting the test
 
1024
SET GLOBAL slow_query_log = @saved_slow_query_log;
 
1025
SET GLOBAL general_log=@saved_general_log;
 
1026
SET SESSION long_query_time =@saved_long_query_time;
 
1027
SET GLOBAL LOG_OUTPUT = @saved_log_output;
 
1028
 
 
1029