diff options
author | unknown <cps@outpost.site> | 2006-01-19 05:56:06 +0300 |
---|---|---|
committer | unknown <cps@outpost.site> | 2006-01-19 05:56:06 +0300 |
commit | 41536fcefe62a3997e8829fb3ccb0f4ff3316fb2 (patch) | |
tree | 7c4ed26ee5f9b700099b772510ed9aa085bad459 /mysql-test/r | |
parent | 471314df6a01f5f8e3f8054a8af4caac9aa0fb10 (diff) | |
download | mariadb-git-41536fcefe62a3997e8829fb3ccb0f4ff3316fb2.tar.gz |
WL1019: complete patch. Reapplied patch to the clean
tree to get rid of multiple typos in CS comments and
unify the patch.
configure.in:
CSV is compiled in by default now
include/my_base.h:
add new ha_extra flag for the log tables
mysql-test/include/im_check_os.inc:
we should only run im tests if csv is on for now: im relies
on mysqld options available only in csv build.
mysql-test/include/system_db_struct.inc:
check log tables structure
mysql-test/lib/init_db.sql:
create log tables when running tests.
mysql-test/mysql-test-run.pl:
Add old logs flag to IM tests. As IM could only deal with
old logs (this feature is not needed with log tables)
mysql-test/r/connect.result:
update result
mysql-test/r/csv.result:
update result
mysql-test/r/im_utils.result:
update result
mysql-test/r/information_schema.result:
update result
mysql-test/r/mysqlcheck.result:
update result
mysql-test/r/show_check.result:
update result
mysql-test/r/system_mysql_db.result:
update result
mysql-test/t/connect.test:
disable test if CSV engine is not in: result depends on the
presence of CSV-based log tables
mysql-test/t/csv.test:
add tests for concurrent insert (the functionality is added
to CSV in this patch)
mysql-test/t/information_schema.test:
disable test if CSV engine is not in: result depends on the
presence of CSV-based log tables
mysql-test/t/mysqlcheck.test:
disable test if CSV engine is not in: result depends on the
presence of CSV-based log tables
mysql-test/t/show_check.test:
disable test if CSV engine is not in: result depends on the
presence of CSV-based log tables
mysql-test/t/system_mysql_db.test:
disable test if CSV engine is not in: result depends on the
presence of CSV-based log tables
mysql-test/t/system_mysql_db_fix.test:
disable test if CSV engine is not in: result depends on the
presence of CSV-based log tables
scripts/mysql_create_system_tables.sh:
new system tables: slow_log and general_log
scripts/mysql_fix_privilege_tables.sql:
add new log tables: use an SP to create them for
non-csv build to work fine.
sql/ha_myisam.cc:
move locking-related checks to the hanlder
sql/ha_myisam.h:
new function declared
sql/handler.h:
new virtual function is added: we should check for handler-related
locking issues in the handler
sql/lock.cc:
from now on we check for handler-related locking issues
in the handler itself rather then in lock.cc
sql/log.cc:
Add log tables support, refactoring: there are log event
handlers with common interface. They are used by the LOGGER
class, which is responsible for their initialization, cleanup
and managment. Logging to the tables provided by one of the
log event handler types.
sql/log.h:
declare new log classes
sql/log_event.cc:
convert old logging routines calls to use new API
sql/mysql_priv.h:
define common log routines and objects
sql/mysqld.cc:
Add support for the log tables. Their initalization, cleanup
and specific options.
sql/share/errmsg.txt:
add new error messages for the log tables
sql/slave.cc:
convert old logging routines calls to use new API
sql/sql_base.cc:
TABLE objects used by the logger should be skipped
during refreshes (as log tables are always opened
and locked). fix table_is_used to skip them. This
is needed for FLUSH LOGS to work
sql/sql_db.cc:
convert old logging routines calls to use new API
sql/sql_delete.cc:
fix TRUNCATE to work with log tables
sql/sql_parse.cc:
command_name is now an array of LEX_STRINGs
sql/sql_prepare.cc:
convert old logging routines calls to use new API
sql/sql_show.cc:
convert old logging routines calls to use new API
sql/sql_table.cc:
don't reoped the log tables for admin purposes
sql/table.cc:
mark log tables as such during the open
sql/table.h:
add log-related info
storage/csv/ha_tina.cc:
add support for concurrent insert (see bk commit - 5.1 tree
(petr:1.1910) for standalone patch), add log tables-specific
csv table handling.
storage/csv/ha_tina.h:
enable concurrent insert for CSV, add log table flag
mysql-test/r/log_tables.result:
New BitKeeper file ``mysql-test/r/log_tables.result''
mysql-test/t/log_tables.test:
New BitKeeper file ``mysql-test/t/log_tables.test''
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/connect.result | 6 | ||||
-rw-r--r-- | mysql-test/r/csv.result | 17 | ||||
-rw-r--r-- | mysql-test/r/im_utils.result | 2 | ||||
-rw-r--r-- | mysql-test/r/information_schema.result | 6 | ||||
-rw-r--r-- | mysql-test/r/log_tables.result | 54 | ||||
-rw-r--r-- | mysql-test/r/mysqlcheck.result | 8 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 24 | ||||
-rw-r--r-- | mysql-test/r/system_mysql_db.result | 27 |
8 files changed, 136 insertions, 8 deletions
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index ed017641aa9..862260346f5 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -5,6 +5,7 @@ columns_priv db event func +general_log help_category help_keyword help_relation @@ -13,6 +14,7 @@ host plugin proc procs_priv +slow_log tables_priv time_zone time_zone_leap_second @@ -34,6 +36,7 @@ columns_priv db event func +general_log help_category help_keyword help_relation @@ -42,6 +45,7 @@ host plugin proc procs_priv +slow_log tables_priv time_zone time_zone_leap_second @@ -71,6 +75,7 @@ columns_priv db event func +general_log help_category help_keyword help_relation @@ -79,6 +84,7 @@ host plugin proc procs_priv +slow_log tables_priv time_zone time_zone_leap_second diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index 3c87c1f4b92..6f58fdfe54a 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -4976,6 +4976,23 @@ c1 4 5 DROP TABLE bug14672; +CREATE TABLE test_concurrent_insert ( val integer ) ENGINE = CSV; +LOCK TABLES test_concurrent_insert READ LOCAL; +INSERT INTO test_concurrent_insert VALUES (1); +SELECT * FROM test_concurrent_insert; +val +1 +SELECT * FROM test_concurrent_insert; +val +UNLOCK TABLES; +LOCK TABLES test_concurrent_insert WRITE; +INSERT INTO test_concurrent_insert VALUES (2); +SELECT * FROM test_concurrent_insert; +val +1 +2 +UNLOCK TABLES; +DROP TABLE test_concurrent_insert; create table t1 (a int) engine=csv; insert t1 values (1); delete from t1; diff --git a/mysql-test/r/im_utils.result b/mysql-test/r/im_utils.result index fbfaeaebcac..e204affc8ec 100644 --- a/mysql-test/r/im_utils.result +++ b/mysql-test/r/im_utils.result @@ -21,6 +21,7 @@ skip-stack-trace VALUE skip-innodb VALUE skip-bdb VALUE skip-ndbcluster VALUE +old-log-format VALUE SHOW INSTANCE OPTIONS mysqld2; option_name value instance_name VALUE @@ -41,6 +42,7 @@ skip-stack-trace VALUE skip-innodb VALUE skip-bdb VALUE skip-ndbcluster VALUE +old-log-format VALUE START INSTANCE mysqld2; STOP INSTANCE mysqld2; SHOW mysqld1 LOG FILES; diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 651dc3fdc96..8778ded244f 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -62,6 +62,7 @@ columns_priv db event func +general_log help_category help_keyword help_relation @@ -70,6 +71,7 @@ host plugin proc procs_priv +slow_log tables_priv time_zone time_zone_leap_second @@ -732,7 +734,7 @@ CREATE TABLE t_crashme ( f1 BIGINT); CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; count(*) -107 +109 drop view a2, a1; drop table t_crashme; select table_schema,table_name, column_name from @@ -816,7 +818,7 @@ SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHE table_schema count(*) cluster_replication 1 information_schema 19 -mysql 19 +mysql 21 create table t1 (i int, j int); create trigger trg1 before insert on t1 for each row begin diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result new file mode 100644 index 00000000000..caaf0367bb7 --- /dev/null +++ b/mysql-test/r/log_tables.result @@ -0,0 +1,54 @@ +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 [] 1 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 [] 1 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"); +insert into join_test values ("Get the table info", "Field List"); +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 +from mysql.general_log join join_test +on (mysql.general_log.command_type = join_test.command_type) +drop table join_test; +flush logs; +lock tables mysql.general_log WRITE; +ERROR HY000: You can't write-lock a log table. Only read access is possible. +lock tables mysql.slow_log WRITE; +ERROR HY000: You can't write-lock a log table. Only read access is possible. +lock tables mysql.general_log READ; +ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead. +lock tables mysql.slow_log READ; +ERROR HY000: You can't use usual read lock with log tables. Try READ LOCAL instead. +lock tables mysql.slow_log READ LOCAL, mysql.general_log READ LOCAL; +unlock tables; +lock tables mysql.general_log READ LOCAL; + flush logs; +unlock tables; +select "Mark that we woke up from flush logs in the test" + as "test passed"; +test passed +Mark that we woke up from flush logs in the test +lock tables mysql.general_log READ LOCAL; + truncate mysql.general_log; +unlock tables; +select "Mark that we woke up from TRUNCATE in the test" + as "test passed"; +test passed +Mark that we woke up from TRUNCATE in the test diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index e6251dd9422..bd4bbc15a4f 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -3,6 +3,8 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK +mysql.general_log +note : The storage engine for the table doesn't support optimize mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -11,6 +13,8 @@ mysql.host OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK +mysql.slow_log +note : The storage engine for the table doesn't support optimize mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK @@ -22,6 +26,8 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK +mysql.general_log +note : The storage engine for the table doesn't support optimize mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -30,6 +36,8 @@ mysql.host OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK +mysql.slow_log +note : The storage engine for the table doesn't support optimize mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index a78230e63eb..960c389eee2 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -147,10 +147,14 @@ drop table t1; flush tables; show open tables; Database Table In_use Name_locked +mysql general_log 1 0 +mysql slow_log 1 0 create table t1(n int); insert into t1 values (1); show open tables; Database Table In_use Name_locked +mysql general_log 1 0 +mysql slow_log 1 0 test t1 0 0 drop table t1; create table t1 (a int not null, b VARCHAR(10), INDEX (b) ) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" ENGINE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed; @@ -564,20 +568,24 @@ SELECT 1 FROM mysql.db, mysql.proc, mysql.user, mysql.time_zone, mysql.time_zone 1 SHOW OPEN TABLES; Database Table In_use Name_locked -mysql db 0 0 +mysql proc 0 0 test urkunde 0 0 mysql time_zone 0 0 -mysql user 0 0 +mysql db 0 0 test txt1 0 0 -mysql proc 0 0 +mysql slow_log 1 0 test tyt2 0 0 +mysql general_log 1 0 +mysql user 0 0 mysql time_zone_name 0 0 SHOW OPEN TABLES FROM mysql; Database Table In_use Name_locked -mysql db 0 0 +mysql proc 0 0 mysql time_zone 0 0 +mysql db 0 0 +mysql slow_log 1 0 +mysql general_log 1 0 mysql user 0 0 -mysql proc 0 0 mysql time_zone_name 0 0 SHOW OPEN TABLES FROM mysql LIKE 'u%'; Database Table In_use Name_locked @@ -590,12 +598,16 @@ test tyt2 0 0 mysql time_zone_name 0 0 SHOW OPEN TABLES LIKE '%o%'; Database Table In_use Name_locked -mysql time_zone 0 0 mysql proc 0 0 +mysql time_zone 0 0 +mysql slow_log 1 0 +mysql general_log 1 0 mysql time_zone_name 0 0 FLUSH TABLES; SHOW OPEN TABLES; Database Table In_use Name_locked +mysql general_log 1 0 +mysql slow_log 1 0 DROP TABLE txt1; DROP TABLE tyt2; DROP TABLE urkunde; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index 2e4e2dc10ea..e3abd7f5200 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -5,6 +5,7 @@ columns_priv db event func +general_log help_category help_keyword help_relation @@ -13,6 +14,7 @@ host plugin proc procs_priv +slow_log tables_priv time_zone time_zone_leap_second @@ -184,6 +186,31 @@ proc CREATE TABLE `proc` ( `comment` char(64) character set utf8 collate utf8_bin NOT NULL default '', PRIMARY KEY (`db`,`name`,`type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' +show create table general_log; +Table Create Table +general_log CREATE TABLE `general_log` ( + `event_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `user_host` mediumtext, + `thread_id` int(11) default NULL, + `server_id` int(11) default NULL, + `command_type` varchar(64) default NULL, + `argument` mediumtext +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' +show create table slow_log; +Table Create Table +slow_log CREATE TABLE `slow_log` ( + `start_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `user_host` mediumtext NOT NULL, + `query_time` time NOT NULL, + `lock_time` time NOT NULL, + `rows_sent` int(11) NOT NULL, + `rows_examined` int(11) NOT NULL, + `db` varchar(512) default NULL, + `last_insert_id` int(11) default NULL, + `insert_id` int(11) default NULL, + `server_id` int(11) default NULL, + `sql_text` mediumtext NOT NULL +) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' show create table event; Table Create Table event CREATE TABLE `event` ( |