mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1-new
into bk-internal.mysql.com:/data0/bk/mysql-5.1-kt sql/mysqld.cc: Auto merged sql/sql_parse.cc: Auto merged
This commit is contained in:
5
mysql-test/r/contributors.result
Normal file
5
mysql-test/r/contributors.result
Normal file
@ -0,0 +1,5 @@
|
||||
SHOW CONTRIBUTORS;
|
||||
Name Location Comment
|
||||
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
|
||||
Sheeri Kritzer Boston, Mass. USA EFF contribution for UC2006 Auction
|
||||
Mark Shuttleworth London, UK. EFF contribution for UC2006 Auction
|
@ -19,7 +19,7 @@ SET GLOBAL event_scheduler=1;
|
||||
"Should see 3 rows - the 'SELect' is in the middle. The other two are selects from general_log"
|
||||
call select_general_log();
|
||||
user_host argument
|
||||
root[root] @ localhost [localhost] SELect 'alabala', sleep(3) from dual
|
||||
USER_HOST SELect 'alabala', sleep(3) from dual
|
||||
DROP PROCEDURE select_general_log;
|
||||
DROP EVENT log_general;
|
||||
SET GLOBAL event_scheduler=2;
|
||||
@ -43,7 +43,7 @@ SLEEP(2)
|
||||
0
|
||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||
user_host query_time db sql_text
|
||||
root[root] @ localhost [] SLEEPVAL events_test SELECT SLEEP(2)
|
||||
USER_HOST SLEEPVAL events_test SELECT SLEEP(2)
|
||||
TRUNCATE mysql.slow_log;
|
||||
CREATE TABLE slow_event_test (slo_val tinyint, val tinyint);
|
||||
"This won't go to the slow log"
|
||||
@ -76,7 +76,7 @@ slo_val val
|
||||
"Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10"
|
||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||
user_host query_time db sql_text
|
||||
root[root] @ localhost [localhost] SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2)
|
||||
USER_HOST SLEEPVAL events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2)
|
||||
DROP EVENT long_event2;
|
||||
SET GLOBAL long_query_time =@old_global_long_query_time;
|
||||
SET SESSION long_query_time =@old_session_long_query_time;
|
||||
|
@ -718,3 +718,16 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I
|
||||
t1 MEMORY 10 Fixed 0 11 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||
t2 MEMORY 10 Fixed 0 12 0 # 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||
drop table t1, t2;
|
||||
CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
|
||||
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;
|
||||
INSERT INTO t1 VALUES('a','aa',REPEAT('a', 256)),('a','aa',REPEAT('a',256));
|
||||
SELECT COUNT(*) FROM t1 WHERE a='a';
|
||||
COUNT(*)
|
||||
2
|
||||
SELECT COUNT(*) FROM t1 WHERE b='aa';
|
||||
COUNT(*)
|
||||
2
|
||||
SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256);
|
||||
COUNT(*)
|
||||
2
|
||||
DROP TABLE t1;
|
||||
|
@ -2,14 +2,14 @@ use mysql;
|
||||
truncate table general_log;
|
||||
select * from general_log;
|
||||
event_time user_host thread_id server_id command_type argument
|
||||
TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query select * from general_log
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from general_log
|
||||
truncate table slow_log;
|
||||
select * from slow_log;
|
||||
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
|
||||
truncate table general_log;
|
||||
select * from general_log where argument like '%general_log%';
|
||||
event_time user_host thread_id server_id command_type argument
|
||||
TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query select * from general_log where argument like '%general_log%'
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from general_log where argument like '%general_log%'
|
||||
create table join_test (verbose_comment varchar (80), command_type varchar(64));
|
||||
insert into join_test values ("User performed a usual SQL query", "Query");
|
||||
insert into join_test values ("New DB connection was registered", "Connect");
|
||||
@ -18,12 +18,12 @@ select verbose_comment, user_host, argument
|
||||
from mysql.general_log join join_test
|
||||
on (mysql.general_log.command_type = join_test.command_type);
|
||||
verbose_comment user_host argument
|
||||
User performed a usual SQL query root[root] @ localhost [] select * from general_log where argument like '%general_log%'
|
||||
User performed a usual SQL query root[root] @ localhost [] create table join_test (verbose_comment varchar (80), command_type varchar(64))
|
||||
User performed a usual SQL query root[root] @ localhost [] insert into join_test values ("User performed a usual SQL query", "Query")
|
||||
User performed a usual SQL query root[root] @ localhost [] insert into join_test values ("New DB connection was registered", "Connect")
|
||||
User performed a usual SQL query root[root] @ localhost [] insert into join_test values ("Get the table info", "Field List")
|
||||
User performed a usual SQL query root[root] @ localhost [] select verbose_comment, user_host, argument
|
||||
User performed a usual SQL query USER_HOST select * from general_log where argument like '%general_log%'
|
||||
User performed a usual SQL query USER_HOST create table join_test (verbose_comment varchar (80), command_type varchar(64))
|
||||
User performed a usual SQL query USER_HOST insert into join_test values ("User performed a usual SQL query", "Query")
|
||||
User performed a usual SQL query USER_HOST insert into join_test values ("New DB connection was registered", "Connect")
|
||||
User performed a usual SQL query USER_HOST insert into join_test values ("Get the table info", "Field List")
|
||||
User performed a usual SQL query USER_HOST select verbose_comment, user_host, argument
|
||||
from mysql.general_log join join_test
|
||||
on (mysql.general_log.command_type = join_test.command_type)
|
||||
drop table join_test;
|
||||
@ -59,10 +59,10 @@ create table bug16905 (s char(15) character set utf8 default 'пусто');
|
||||
insert into bug16905 values ('новое');
|
||||
select * from mysql.general_log;
|
||||
event_time user_host thread_id server_id command_type argument
|
||||
TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query set names utf8
|
||||
TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query create table bug16905 (s char(15) character set utf8 default 'пусто')
|
||||
TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query insert into bug16905 values ('новое')
|
||||
TIMESTAMP root[root] @ localhost [] THREAD_ID 1 Query select * from mysql.general_log
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query set names utf8
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query create table bug16905 (s char(15) character set utf8 default 'пусто')
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query insert into bug16905 values ('новое')
|
||||
TIMESTAMP USER_HOST THREAD_ID 1 Query select * from mysql.general_log
|
||||
drop table bug16905;
|
||||
truncate table mysql.slow_log;
|
||||
set session long_query_time=1;
|
||||
@ -71,4 +71,4 @@ sleep(2)
|
||||
0
|
||||
select * from mysql.slow_log;
|
||||
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
|
||||
TIMESTAMP, root[root] @ localhost [] USER_HOST, QUERY_TIME 1 0 test 0 0 1 select sleep(2)
|
||||
TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(2)
|
||||
|
1
mysql-test/t/contributors.test
Normal file
1
mysql-test/t/contributors.test
Normal file
@ -0,0 +1 @@
|
||||
SHOW CONTRIBUTORS;
|
@ -14,11 +14,13 @@ SET GLOBAL event_scheduler=2;
|
||||
create event log_general on schedule every 1 minute do SELect 'alabala', sleep(3) from dual;
|
||||
TRUNCATE mysql.general_log;
|
||||
--echo "1 row, the current statement!"
|
||||
--replace_column 1 USER_HOST
|
||||
call select_general_log();
|
||||
SET GLOBAL event_scheduler=1;
|
||||
--echo "Wait the scheduler to start"
|
||||
--echo "Should see 3 rows - the 'SELect' is in the middle. The other two are selects from general_log"
|
||||
--sleep 2
|
||||
--replace_column 1 USER_HOST
|
||||
call select_general_log();
|
||||
DROP PROCEDURE select_general_log;
|
||||
DROP EVENT log_general;
|
||||
@ -50,13 +52,14 @@ SET @old_session_long_query_time:=@@long_query_time;
|
||||
SHOW VARIABLES LIKE 'log_slow_queries';
|
||||
DROP FUNCTION get_value;
|
||||
TRUNCATE mysql.slow_log;
|
||||
--replace_column 1 USER_HOST
|
||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||
--echo "Set new values"
|
||||
SET GLOBAL long_query_time=4;
|
||||
SET SESSION long_query_time=1;
|
||||
--echo "Check that logging is working"
|
||||
SELECT SLEEP(2);
|
||||
--replace_regex /00:00:0[2-4]/SLEEPVAL/
|
||||
--replace_column 1 USER_HOST 2 SLEEPVAL
|
||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||
TRUNCATE mysql.slow_log;
|
||||
CREATE TABLE slow_event_test (slo_val tinyint, val tinyint);
|
||||
@ -81,7 +84,7 @@ CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_te
|
||||
--echo "Check our table. Should see 2 rows"
|
||||
SELECT * FROM slow_event_test;
|
||||
--echo "Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10"
|
||||
--replace_regex /00:00:0[2-4]/SLEEPVAL/
|
||||
--replace_column 1 USER_HOST 2 SLEEPVAL
|
||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||
DROP EVENT long_event2;
|
||||
SET GLOBAL long_query_time =@old_global_long_query_time;
|
||||
|
@ -458,4 +458,16 @@ create table t2 (c varchar(10)) engine=memory;
|
||||
show table status like 't_';
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# BUG#18233 - Memory tables INDEX USING HASH (a,b) returns 1 row on
|
||||
# SELECT WHERE a= AND b=
|
||||
#
|
||||
CREATE TABLE t1(a VARCHAR(1), b VARCHAR(2), c VARCHAR(256),
|
||||
KEY(a), KEY(b), KEY(c)) ENGINE=MEMORY;
|
||||
INSERT INTO t1 VALUES('a','aa',REPEAT('a', 256)),('a','aa',REPEAT('a',256));
|
||||
SELECT COUNT(*) FROM t1 WHERE a='a';
|
||||
SELECT COUNT(*) FROM t1 WHERE b='aa';
|
||||
SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256);
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 5.0 tests
|
||||
|
@ -16,10 +16,10 @@ use mysql;
|
||||
#
|
||||
|
||||
truncate table general_log;
|
||||
--replace_column 1 TIMESTAMP 3 THREAD_ID
|
||||
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID
|
||||
select * from general_log;
|
||||
truncate table slow_log;
|
||||
--replace_column 1 TIMESTAMP
|
||||
--replace_column 1 TIMESTAMP 2 USER_HOST
|
||||
select * from slow_log;
|
||||
|
||||
#
|
||||
@ -31,7 +31,7 @@ select * from slow_log;
|
||||
#
|
||||
|
||||
truncate table general_log;
|
||||
--replace_column 1 TIMESTAMP 3 THREAD_ID
|
||||
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID
|
||||
select * from general_log where argument like '%general_log%';
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ insert into join_test values ("User performed a usual SQL query", "Query");
|
||||
insert into join_test values ("New DB connection was registered", "Connect");
|
||||
insert into join_test values ("Get the table info", "Field List");
|
||||
|
||||
--replace_column 2 USER_HOST
|
||||
select verbose_comment, user_host, argument
|
||||
from mysql.general_log join join_test
|
||||
on (mysql.general_log.command_type = join_test.command_type);
|
||||
@ -156,7 +157,7 @@ truncate table mysql.general_log;
|
||||
set names utf8;
|
||||
create table bug16905 (s char(15) character set utf8 default 'пусто');
|
||||
insert into bug16905 values ('новое');
|
||||
--replace_column 1 TIMESTAMP 3 THREAD_ID
|
||||
--replace_column 1 TIMESTAMP 2 USER_HOST 3 THREAD_ID
|
||||
select * from mysql.general_log;
|
||||
drop table bug16905;
|
||||
|
||||
@ -167,7 +168,7 @@ drop table bug16905;
|
||||
truncate table mysql.slow_log;
|
||||
set session long_query_time=1;
|
||||
select sleep(2);
|
||||
--replace_column 1 TIMESTAMP, 3 USER_HOST, 4 QUERY_TIME
|
||||
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
|
||||
select * from mysql.slow_log;
|
||||
|
||||
# kill all connections
|
||||
|
Reference in New Issue
Block a user