From 12ede0e0be7cf6b391b487d41b0e3aa4a4cc3563 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 May 2006 17:53:26 -0700 Subject: [PATCH 01/13] Added new show contributors command. sql/lex.h: Additions for show contributors sql/mysql_priv.h: Show contributors addition sql/sp_head.cc: Added for show contributors sql/sql_lex.h: Adding contributors addition sql/sql_parse.cc: Execute for add contributors sql/sql_show.cc: Adding show contributors sql/sql_yacc.yy: Show contributors additio mysql-test/r/contributors.result: New BitKeeper file ``mysql-test/r/contributors.result'' mysql-test/t/contributors.test: New BitKeeper file ``mysql-test/t/contributors.test'' sql/contributors.h: New BitKeeper file ``sql/contributors.h'' --- mysql-test/r/contributors.result | 5 ++++ mysql-test/t/contributors.test | 1 + sql/contributors.h | 40 ++++++++++++++++++++++++++++++++ sql/lex.h | 1 + sql/mysql_priv.h | 1 + sql/sp_head.cc | 1 + sql/sql_lex.h | 1 + sql/sql_parse.cc | 3 +++ sql/sql_show.cc | 36 ++++++++++++++++++++++++++++ sql/sql_yacc.yy | 6 +++++ 10 files changed, 95 insertions(+) create mode 100644 mysql-test/r/contributors.result create mode 100644 mysql-test/t/contributors.test create mode 100644 sql/contributors.h diff --git a/mysql-test/r/contributors.result b/mysql-test/r/contributors.result new file mode 100644 index 00000000000..5739c2244c3 --- /dev/null +++ b/mysql-test/r/contributors.result @@ -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 diff --git a/mysql-test/t/contributors.test b/mysql-test/t/contributors.test new file mode 100644 index 00000000000..e463c4a888b --- /dev/null +++ b/mysql-test/t/contributors.test @@ -0,0 +1 @@ +SHOW CONTRIBUTORS; diff --git a/sql/contributors.h b/sql/contributors.h new file mode 100644 index 00000000000..dca232b9b69 --- /dev/null +++ b/sql/contributors.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2005 MySQL AB & MySQL Finland AB & TCX DataKonsult AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* Structure of the name list */ + +struct show_table_contributors_st { + const char *name; + const char *location; + const char *comment; +}; + +/* + Output from "SHOW CONTRIBUTORS" + + Get permission before editing. + + IMPORTANT: Names should be left in historical order. + + Names should be encoded using UTF-8. +*/ + +struct show_table_contributors_st show_table_contributors[]= { + {"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"}, + {NULL, NULL, NULL} +}; diff --git a/sql/lex.h b/sql/lex.h index 171f7a48980..f3c8fca089e 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -133,6 +133,7 @@ static SYMBOL symbols[] = { { "CONSTRAINT", SYM(CONSTRAINT)}, { "CONTAINS", SYM(CONTAINS_SYM)}, { "CONTINUE", SYM(CONTINUE_SYM)}, + { "CONTRIBUTORS", SYM(CONTRIBUTORS_SYM)}, { "CONVERT", SYM(CONVERT_SYM)}, { "CREATE", SYM(CREATE)}, { "CROSS", SYM(CROSS)}, diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index bc398b3d20a..22e4443f302 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1002,6 +1002,7 @@ int mysql_find_files(THD *thd,List *files, const char *db, const char *path, const char *wild, bool dir); bool mysqld_show_storage_engines(THD *thd); bool mysqld_show_authors(THD *thd); +bool mysqld_show_contributors(THD *thd); bool mysqld_show_privileges(THD *thd); bool mysqld_show_column_types(THD *thd); bool mysqld_help (THD *thd, const char *text); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index fbdb9a72640..a4367085f1b 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -202,6 +202,7 @@ sp_get_flags_for_command(LEX *lex) case SQLCOM_SHOW_PROC_CODE: case SQLCOM_SHOW_FUNC_CODE: case SQLCOM_SHOW_AUTHORS: + case SQLCOM_SHOW_CONTRIBUTORS: case SQLCOM_REPAIR: case SQLCOM_BACKUP_TABLE: case SQLCOM_RESTORE_TABLE: diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 47fbc685bab..f31e7c2c666 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -110,6 +110,7 @@ enum enum_sql_command { SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN, SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT, SQLCOM_SHOW_PLUGINS, + SQLCOM_SHOW_CONTRIBUTORS, SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT, SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2886f6dc267..e425c12dd91 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3522,6 +3522,9 @@ end_with_restore_list: case SQLCOM_SHOW_AUTHORS: res= mysqld_show_authors(thd); break; + case SQLCOM_SHOW_CONTRIBUTORS: + res= mysqld_show_contributors(thd); + break; case SQLCOM_SHOW_PRIVILEGES: res= mysqld_show_privileges(thd); break; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 95433828a1e..0a854b84ee5 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -25,6 +25,7 @@ #include "sp_head.h" #include "sql_trigger.h" #include "authors.h" +#include "contributors.h" #include "event.h" #include @@ -226,6 +227,41 @@ bool mysqld_show_authors(THD *thd) DBUG_RETURN(FALSE); } + +/*************************************************************************** +** List all Contributors. +** Please get permission before updating +***************************************************************************/ + +bool mysqld_show_contributors(THD *thd) +{ + List field_list; + Protocol *protocol= thd->protocol; + DBUG_ENTER("mysqld_show_contributors"); + + field_list.push_back(new Item_empty_string("Name",40)); + field_list.push_back(new Item_empty_string("Location",40)); + field_list.push_back(new Item_empty_string("Comment",80)); + + if (protocol->send_fields(&field_list, + Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) + DBUG_RETURN(TRUE); + + show_table_contributors_st *contributors; + for (contributors= show_table_contributors; contributors->name; contributors++) + { + protocol->prepare_for_resend(); + protocol->store(contributors->name, system_charset_info); + protocol->store(contributors->location, system_charset_info); + protocol->store(contributors->comment, system_charset_info); + if (protocol->write()) + DBUG_RETURN(TRUE); + } + send_eof(thd); + DBUG_RETURN(FALSE); +} + + /*************************************************************************** List all privileges supported ***************************************************************************/ diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ab87c78d17c..492d27a3341 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -204,6 +204,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token CONSTRAINT %token CONTAINS_SYM %token CONTINUE_SYM +%token CONTRIBUTORS_SYM %token CONVERT_SYM %token CONVERT_TZ_SYM %token COUNT_SYM @@ -8128,6 +8129,11 @@ show_param: LEX *lex=Lex; lex->sql_command= SQLCOM_SHOW_AUTHORS; } + | CONTRIBUTORS_SYM + { + LEX *lex=Lex; + lex->sql_command= SQLCOM_SHOW_CONTRIBUTORS; + } | PRIVILEGES { LEX *lex=Lex; From 2eeab0b0d8e561fec1451e7f763de4526236962b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 May 2006 21:50:04 +0500 Subject: [PATCH 02/13] BUG#18233 - Memory tables INDEX USING HASH (a,b) returns 1 row on SELECT WHERE a= AND b= Selecting data from memory table with varchar column and hash index over it returns only first row matched. Problem was that key length calculation for varchar columns didn't include number of bytes to store length. Fixed key length for varchar fields to include number of bytes to store length. heap/hp_create.c: Fixed key length for varchar fields to include number of bytes to store length. mysql-test/r/heap.result: Testcase for BUG#18233. mysql-test/t/heap.test: Testcase for BUG#18233. --- heap/hp_create.c | 2 ++ mysql-test/r/heap.result | 13 +++++++++++++ mysql-test/t/heap.test | 12 ++++++++++++ 3 files changed, 27 insertions(+) diff --git a/heap/hp_create.c b/heap/hp_create.c index 9ffa4e33108..eb7a068c78b 100644 --- a/heap/hp_create.c +++ b/heap/hp_create.c @@ -85,6 +85,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, if (!my_binary_compare(keyinfo->seg[j].charset)) keyinfo->flag|= HA_END_SPACE_KEY; keyinfo->flag|= HA_VAR_LENGTH_KEY; + length+= 2; /* Save number of bytes used to store length */ keyinfo->seg[j].bit_start= 1; break; @@ -95,6 +96,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, if (!my_binary_compare(keyinfo->seg[j].charset)) keyinfo->flag|= HA_END_SPACE_KEY; keyinfo->flag|= HA_VAR_LENGTH_KEY; + length+= 2; /* Save number of bytes used to store length */ keyinfo->seg[j].bit_start= 2; /* diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index d72f5771f15..906c431b834 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -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; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 82294db336d..e501fce1eeb 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -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 From fe7716dad927beb48709cfebbe3355c8495750c1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 May 2006 17:46:34 +0500 Subject: [PATCH 03/13] BUG#19907 - simple_parser plugin cannot be installed The problem was that simple_parser was compiled as static plugin, which is intended to be linked into server, but not plugged. This patch makes simple_parser to be compiled as dynamic plugin by adding -DMYSQL_DYNAMIC_PLUGIN into CFLAGS. plugin/fulltext/Makefile.am: Compile mypluglib as dynamic mysql plugin. --- plugin/fulltext/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fulltext/Makefile.am b/plugin/fulltext/Makefile.am index 4df5a1dc78a..7b4ae22cbd2 100644 --- a/plugin/fulltext/Makefile.am +++ b/plugin/fulltext/Makefile.am @@ -6,4 +6,4 @@ noinst_LTLIBRARIES= mypluglib.la #pkglib_LTLIBRARIES= mypluglib.la mypluglib_la_SOURCES= plugin_example.c mypluglib_la_LDFLAGS= -module -rpath $(pkglibdir) - +mypluglib_la_CFLAGS= -DMYSQL_DYNAMIC_PLUGIN From bd578562f2f270b6e9771bbca0f3c3de847c42c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 May 2006 17:15:49 +0200 Subject: [PATCH 04/13] Fix BUILD/compile-pentium-gcov BUILD/compile-pentium-gcov: Add -max options for gcov, fix yassl and BDB builds, disable ccache which is incompatible with gcc profiling output. --- BUILD/compile-pentium-gcov | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov index 05cb0bb0d78..b024bba49bf 100755 --- a/BUILD/compile-pentium-gcov +++ b/BUILD/compile-pentium-gcov @@ -3,8 +3,19 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage" +# Need to disable ccache, or we loose the gcov-needed compiler output files. +CCACHE_DISABLE=1 +export CCACHE_DISABLE + +# GCC4 needs -fprofile-arcs -ftest-coverage on the linker command line (as well +# as on the compiler command line), and this requires setting LDFLAGS for BDB. +export LDFLAGS="-fprofile-arcs -ftest-coverage" + +# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the +# code with profiling information used by gcov. +# the -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl. +extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM" extra_configs="$pentium_configs $debug_configs --disable-shared $static_link" -extra_configs="$extra_configs --with-innodb --with-berkeley-db" +extra_configs="$extra_configs $max_configs" . "$path/FINISH.sh" From 5b2cade4fa604b0c88de782341a0ad1e2a74bb10 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 May 2006 11:34:41 -0700 Subject: [PATCH 05/13] Bug #20004: log_tables fails on Windows due to output differences This test included hostname information in the output, which varies between platforms. mysql-test/r/log_tables.result: Update results mysql-test/t/log_tables.test: Replace user_host selected from logs to avoid platform differences. Also, fix use of replace_column in test for bug 17600. --- mysql-test/r/log_tables.result | 26 +++++++++++++------------- mysql-test/t/log_tables.test | 11 ++++++----- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 2164c18823f..08b1d473186 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -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 [] 1 1 Query select * from general_log +TIMESTAMP USER_HOST 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%' +TIMESTAMP USER_HOST 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"); @@ -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 [] 2 1 Query set names utf8 -TIMESTAMP root[root] @ localhost [] 2 1 Query create table bug16905 (s char(15) character set utf8 default 'пусто') -TIMESTAMP root[root] @ localhost [] 2 1 Query insert into bug16905 values ('новое') -TIMESTAMP root[root] @ localhost [] 2 1 Query select * from mysql.general_log +TIMESTAMP USER_HOST 2 1 Query set names utf8 +TIMESTAMP USER_HOST 2 1 Query create table bug16905 (s char(15) character set utf8 default 'пусто') +TIMESTAMP USER_HOST 2 1 Query insert into bug16905 values ('новое') +TIMESTAMP USER_HOST 2 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) diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index 048da802d02..c5e8041be99 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -16,10 +16,10 @@ use mysql; # truncate table general_log; ---replace_column 1 TIMESTAMP +--replace_column 1 TIMESTAMP 2 USER_HOST 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 +--replace_column 1 TIMESTAMP 2 USER_HOST 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 +--replace_column 1 TIMESTAMP 2 USER_HOST 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 From f29550142ccfef65649a95a2458a463ba40b3810 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2006 09:25:07 +0200 Subject: [PATCH 06/13] Bug#20018 Class declared inside of function causes problem with gcc 2.95.3 - Move class MY_HOOKS out of function sql/sql_insert.cc: Move class MY_HOOKS out of function 'select_create::prepare' --- sql/sql_insert.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 675fb256b32..84760e93d8e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2674,24 +2674,24 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, } +class MY_HOOKS : public TABLEOP_HOOKS { +public: + MY_HOOKS(select_create *x) : ptr(x) { } + virtual void do_prelock(TABLE **tables, uint count) + { + if (ptr->get_thd()->current_stmt_binlog_row_based) + ptr->binlog_show_create_table(tables, count); + } + +private: + select_create *ptr; +}; + int select_create::prepare(List &values, SELECT_LEX_UNIT *u) { DBUG_ENTER("select_create::prepare"); - class MY_HOOKS : public TABLEOP_HOOKS { - public: - MY_HOOKS(select_create *x) : ptr(x) { } - virtual void do_prelock(TABLE **tables, uint count) - { - if (ptr->get_thd()->current_stmt_binlog_row_based) - ptr->binlog_show_create_table(tables, count); - } - - private: - select_create *ptr; - }; - MY_HOOKS hooks(this); unit= u; From 1d41f34f9aa64ea986f9e21c55e914650a5e4bae Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2006 10:07:07 +0200 Subject: [PATCH 07/13] Bug#20002 Old --with-openssl and --with-yassl options just silently ignored - Terminate configure with error(and message) if --with-yassl or --with-openssl is used. config/ac-macros/ssl.m4: Add error message if --with-yassl or --with-openssl is used --- config/ac-macros/ssl.m4 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/config/ac-macros/ssl.m4 b/config/ac-macros/ssl.m4 index 14f3dcc9bc8..0f2f207c36f 100644 --- a/config/ac-macros/ssl.m4 +++ b/config/ac-macros/ssl.m4 @@ -23,7 +23,7 @@ AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [ extra/yassl/src/Makefile dnl extra/yassl/testsuite/Makefile) - with_yassl="yes" + with_bundled_yassl="yes" yassl_dir="yassl" AC_SUBST([yassl_dir]) @@ -174,6 +174,16 @@ AC_MSG_CHECKING(for SSL) [mysql_ssl_dir="$withval"], [mysql_ssl_dir=no]) + if test "$with_yassl" + then + AC_MSG_ERROR([The flag --with-yassl is deprecated, use --with-ssl]) + fi + + if test "$with_openssl" + then + AC_MSG_ERROR([The flag --with-openssl is deprecated, use --with-ssl]) + fi + case "$mysql_ssl_dir" in "no") # @@ -196,5 +206,5 @@ AC_MSG_CHECKING(for SSL) MYSQL_FIND_OPENSSL([$mysql_ssl_dir]) ;; esac - AM_CONDITIONAL([HAVE_YASSL], [ test "$with_yassl" = "yes" ]) + AM_CONDITIONAL([HAVE_YASSL], [ test "$with_bundled_yassl" = "yes" ]) ]) From 05d44302b93f480fd2daefefbb8887ffe466ab0f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2006 16:50:01 +0200 Subject: [PATCH 08/13] __FUNCTION__ is not available everywhere. make us see at least with gcc the function proto. this can be extended probably for windows too. Fix build on intelxeon3 (sun compiler and others) sql/event_scheduler.cc: __FUNCTION__ is not available everywhere. make us see at least with gcc the function proto. this can be extended probably for windows too. --- sql/event_scheduler.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 784c87c0e8e..8bb43164e96 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -236,9 +236,16 @@ about conditional variables used. */ +#ifdef __GNUC__ +#if __GNUC__ >= 2 +#define SCHED_FUNC __FUNCTION__ +#endif +#else +#define SCHED_FUNC "" +#endif -#define LOCK_SCHEDULER_DATA() lock_data(__FUNCTION__,__LINE__) -#define UNLOCK_SCHEDULER_DATA() unlock_data(__FUNCTION__,__LINE__) +#define LOCK_SCHEDULER_DATA() lock_data(SCHED_FUNC, __LINE__) +#define UNLOCK_SCHEDULER_DATA() unlock_data(SCHED_FUNC, __LINE__) #ifndef DBUG_OFF From 7d01d11c8dc387645d68395d3f1659f2f8b2597b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2006 18:27:54 +0300 Subject: [PATCH 09/13] Removed wrong ascii codes from source code. Fixed core dump in --help include/heap.h: Removed a wrong character (ascii 0xa0), which looked like a space. This will cause some debuggers display the source code in a wrong way. May cut the rest of the file off and looks like a debugger problem, which it isn't. mysys/my_getopt.c: Removed a wrong character (ascii 0xa0), which looked like a space. This will cause some debuggers display the source code in a wrong way. May cut the rest of the file off and looks like a debugger problem, which it isn't. sql/mysqld.cc: Wrong type. --- include/heap.h | 2 +- mysys/my_getopt.c | 2 +- sql/mysqld.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/heap.h b/include/heap.h index 855cff117e2..4c003462a45 100644 --- a/include/heap.h +++ b/include/heap.h @@ -111,7 +111,7 @@ struct st_heap_info; /* For referense */ typedef struct st_hp_keydef /* Key definition with open */ { - uint flag; /* HA_NOSAME |HA_NULL_PART_KEY */ + uint flag; /* HA_NOSAME | HA_NULL_PART_KEY */ uint keysegs; /* Number of key-segment */ uint length; /* Length of key (automatic) */ uint8 algorithm; /* HASH / BTREE */ diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 95dc5afeae9..4de2984d9b9 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -486,7 +486,7 @@ invalid value '%s'\n", } get_one_option(optp->id, optp, argument); - (*argc)--; /* option handled (shortorlong), decrease argument count */ + (*argc)--; /* option handled (short or long), decrease argument count */ } else /* non-option found */ (*argv)[argvpos++]= cur_arg; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ccf52113c23..2a8fe21f656 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5004,7 +5004,7 @@ Disable with --skip-bdb (will save memory).", (gptr*) &global_system_variables.engine_condition_pushdown, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"event-scheduler", OPT_EVENT_SCHEDULER, "Enable/disable the event scheduler.", - (gptr*) &Events::opt_event_scheduler, (gptr*) &Events::opt_event_scheduler, 0, GET_STR, + (gptr*) &Events::opt_event_scheduler, (gptr*) &Events::opt_event_scheduler, 0, GET_ULONG, REQUIRED_ARG, 2/*default*/, 0/*min-value*/, 2/*max-value*/, 0, 0, 0}, {"exit-info", 'T', "Used for debugging; Use at your own risk!", 0, 0, 0, GET_LONG, OPT_ARG, 0, 0, 0, 0, 0, 0}, From 4cf24a5160129c6f8d292417e81539f2faf6b2c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2006 17:47:17 +0200 Subject: [PATCH 10/13] event_scheduler.h, event_scheduler.cc: Rename load_event() to load_named_event(), to avoid name clash on HP-UX sql/event_scheduler.cc: Rename load_event() to load_named_event(), to avoid name clash on HP-UX sql/event_scheduler.h: Rename load_event() to load_named_event(), to avoid name clash on HP-UX --- sql/event_scheduler.cc | 8 ++++---- sql/event_scheduler.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 8bb43164e96..0644f8ec534 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -774,7 +774,7 @@ Event_scheduler::add_event(THD *thd, Event_timed *et, bool check_existence) } /* We need to load the event on scheduler_root */ - if (!(res= load_event(thd, et, &et_new))) + if (!(res= load_named_event(thd, et, &et_new))) { queue_insert_safe(&queue, (byte *) et_new); DBUG_PRINT("info", ("Sending COND_new_work")); @@ -909,7 +909,7 @@ Event_scheduler::replace_event(THD *thd, Event_timed *et, LEX_STRING *new_schema 1. Error occured 2. If the replace is DISABLED, we don't load it into the queue. */ - if (!(res= load_event(thd, et, &et_new))) + if (!(res= load_named_event(thd, et, &et_new))) { queue_insert_safe(&queue, (byte *) et_new); DBUG_PRINT("info", ("Sending COND_new_work")); @@ -2032,7 +2032,7 @@ Event_scheduler::events_count() the table, compiles and inserts it into the cache. SYNOPSIS - Event_scheduler::load_event() + Event_scheduler::load_named_event() thd THD etn The name of the event to load and compile on scheduler's root etn_new The loaded event @@ -2043,7 +2043,7 @@ Event_scheduler::events_count() */ enum Event_scheduler::enum_error_code -Event_scheduler::load_event(THD *thd, Event_timed *etn, Event_timed **etn_new) +Event_scheduler::load_named_event(THD *thd, Event_timed *etn, Event_timed **etn_new) { int ret= 0; MEM_ROOT *tmp_mem_root; diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h index 247b4481c9f..dffd47539fa 100644 --- a/sql/event_scheduler.h +++ b/sql/event_scheduler.h @@ -152,7 +152,7 @@ private: stop_all_running_events(THD *thd); enum enum_error_code - load_event(THD *thd, Event_timed *etn, Event_timed **etn_new); + load_named_event(THD *thd, Event_timed *etn, Event_timed **etn_new); int load_events_from_db(THD *thd); From 4bccc3361a26fe6d85f0546db97358a8d13498c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2006 17:26:56 -0700 Subject: [PATCH 11/13] Removing mysql_explain_log from 5.1 BitKeeper/deleted/.del-mysql_explain_log.sh~5ddc62808e16bd57: Delete: scripts/mysql_explain_log.sh scripts/Makefile.am: Removing mysql_explain_log scripts/make_binary_distribution.sh: Removing mysql_explain_log support-files/mysql.spec.sh: Remove reference to mysql_explain_log --- scripts/Makefile.am | 3 - scripts/make_binary_distribution.sh | 2 +- scripts/mysql_explain_log.sh | 392 ---------------------------- support-files/mysql.spec.sh | 1 - 4 files changed, 1 insertion(+), 397 deletions(-) delete mode 100644 scripts/mysql_explain_log.sh diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 56a2d4a7bc6..af3cbc19cb5 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -30,7 +30,6 @@ bin_SCRIPTS = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ - mysql_explain_log \ mysqld_multi \ mysql_create_system_tables @@ -55,7 +54,6 @@ EXTRA_SCRIPTS = make_binary_distribution.sh \ mysql_find_rows.sh \ mysqlhotcopy.sh \ mysqldumpslow.sh \ - mysql_explain_log.sh \ mysqld_multi.sh \ mysqld_safe.sh \ mysql_create_system_tables.sh @@ -83,7 +81,6 @@ CLEANFILES = @server_scripts@ \ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ - mysql_explain_log \ mysql_tableinfo \ mysqld_multi \ make_win_src_distribution \ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index aa29d48d50d..1b071a294ed 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -148,7 +148,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ if [ $BASE_SYSTEM = "netware" ] ; then BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ - netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ + netware/init_db.sql netware/test_db.sql$BS \ netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; # For all other platforms: diff --git a/scripts/mysql_explain_log.sh b/scripts/mysql_explain_log.sh deleted file mode 100644 index 973d9e8a363..00000000000 --- a/scripts/mysql_explain_log.sh +++ /dev/null @@ -1,392 +0,0 @@ -#!@PERL@ -w -use strict; -use DBI; - -use Getopt::Long; -$Getopt::Long::ignorecase=0; - -print "explain_log provided by http://www.mobile.de\n"; -print "=========== ================================\n"; - -my $Param={}; - -$Param->{host}=''; -$Param->{user}=''; -$Param->{password}=''; -$Param->{PrintError}=0; -$Param->{socket}=''; - -if (!GetOptions ('date|d:i' => \$Param->{ViewDate}, - 'host|h:s' => \$Param->{host}, - 'user|u:s' => \$Param->{user}, - 'password|p:s' => \$Param->{password}, - 'printerror|e:s' => \$Param->{PrintError}, - 'socket|s:s' => \$Param->{socket}, - )) { - ShowOptions(); -} -else { - $Param->{UpdateCount} = 0; - $Param->{SelectCount} = 0; - $Param->{IdxUseCount} = 0; - $Param->{LineCount} = 0; - - $Param->{Init} = 0; - $Param->{Field} = 0; - $Param->{Refresh} = 0; - $Param->{QueryCount} = 0; - $Param->{Statistics} =0; - - $Param->{Query} = undef; - $Param->{ALL} = undef ; - $Param->{Comment} = undef ; - - @{$Param->{Rows}} = (qw|possible_keys key type|); - - if ($Param->{ViewDate}) { - $Param->{View} = 0; - } - else { - $Param->{View} = 1; - } - - #print "Date=$Param->{ViewDate}, host=$Param->{host}, user=$Param->{user}, password=$Param->{password}\n"; - - $Param->{dbh}=DBI->connect("DBI:mysql:host=$Param->{host}".($Param->{socket}?";mysql_socket=$Param->{socket}":""),$Param->{user},$Param->{password},{PrintError=>0}); - if (DBI::err()) { - print "Error: " . DBI::errstr() . "\n"; - } - else { - $Param->{Start} = time; - while() { - $Param->{LineCount} ++ ; - - if ($Param->{ViewDate} ) { - if (m/^(\d{6})\s+\d{1,2}:\d\d:\d\d\s.*$/) { # get date - #print "# $1 #\n"; - if ($1 == $Param->{ViewDate}) { - $Param->{View} = 1; - } - else { - $Param->{View} = 0; - } - } - } - if ($Param->{View} ) { - #print "->>>$_"; - - if (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) - #print "C-$1--$2--$3------\n"; - RunQuery($Param); - if (defined $3) { - $Param->{CID}->{$2} = $3 ; - #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Connect.+$/i) { # get connection ID($2) and database($3) - #print "\n <<<<<<<<<<<<<<<<<<----------------------------<<<<<<<<<<<<<<<< \n"; - #print "Connect \n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Change user .*\s+on\s+(.*)$/i) { # get connection ID($2) and database($3) - #print "C-$1--$2--$3------\n"; - RunQuery($Param); - if (defined $3) { - $Param->{CID}->{$2} = $3 ; - #print "DB:$Param->{CID}->{$2} .. $2 .. $3 \n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Quit\s+$/i) { # remove connection ID($2) and querystring - #print "Q-$1--$2--------\n"; - RunQuery($Param); - delete $Param->{CID}->{$2} ; - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(select.+)$/i) { # get connection ID($2) and querystring - #print "S1-$1--$2--$3------\n"; - RunQuery($Param); - unless ($Param->{CID}->{$2}) { - #print "Error: No Database for Handle: $2 found\n"; - } - else { - $Param->{DB}=$Param->{CID}->{$2}; - - my $s = "$3"; - $s =~ s/from\s/from $Param->{DB}./i; - $Param->{Query}="EXPLAIN $s"; - - #$s =~ m/from\s+(\w+[.]\w+)/i; - #$Param->{tab} =$1; - #print "-- $Param->{tab} -- $s --\n"; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(update.+)$/i) { # get connection ID($2) and querystring - #print "S2--$1--$2--$3------\n"; - RunQuery($Param); - unless ($Param->{CID}->{$2}) { - #print "Error: No Database for Handle: $2 found\n"; - } - else { - $Param->{DB}=$Param->{CID}->{$2}; - - my $ud = $3; - $ud =~ m/^update\s+(\w+).+(where.+)$/i; - $Param->{Query} ="EXPLAIN SELECT * FROM $1 $2"; - $Param->{Query} =~ s/from\s/from $Param->{DB}./i; - - #$Param->{Query} =~ m/from\s+(\w+[.]\w+)/i; - #$Param->{tab} =$1; - } - } - - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Statistics\s+(.*)$/i) { # get connection ID($2) and info? - $Param->{Statistics} ++; - #print "Statistics--$1--$2--$3------\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Query\s+(.+)$/i) { # get connection ID($2) - $Param->{QueryCount} ++; - #print "Query-NULL $3\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Refresh\s+(.+)$/i) { # get connection ID($2) - $Param->{Refresh} ++; - #print "Refresh\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Init\s+(.+)$/i) { # get connection ID($2) - $Param->{Init} ++; - #print "Init $3\n"; - RunQuery($Param); - } - elsif (m/^(\d{6}\s+\d{1,2}:\d\d:\d\d\s+|\s+)(\d+)\s+Field\s+(.+)$/i) { # get connection ID($2) - $Param->{Field} ++; - #print "Field $3\n"; - RunQuery($Param); - } - - elsif (m/^\s+(.+)$/ ) { # command could be some lines ... - #print "multi-lined ($1)\n"; - my ($A)=$1; - chomp $A; - $Param->{Query} .= " $1"; - #print "multi-lined ($1)<<$Param->{Query}>>\n"; - } - - - } - - } - - $Param->{dbh}->disconnect(); - - if (1 == 0) { - print "\nunclosed handles----------------------------------------\n"; - my $count=0; - foreach (sort keys %{$Param->{CID}}) { - print "$count | $_ : $Param->{CID}->{$_} \n"; - $count ++; - } - } - - print "\nIndex usage ------------------------------------\n"; - foreach my $t (sort keys %{$Param->{Data}}) { - print "\nTable\t$t: ---\n"; - foreach my $k (sort keys %{$Param->{Data}->{$t}}) { - print " count\t$k:\n"; - my %h = %{$Param->{Data}->{$t}->{$k}}; - foreach (sort {$h{$a} <=> $h{$b}} keys %h) { - print " $Param->{Data}->{$t}->{$k}->{$_}\t$_\n"; - } - } - } - - $Param->{AllCount}=0; - print "\nQueries causing table scans -------------------\n\n"; - foreach (@{$Param->{ALL}}) { - $Param->{AllCount} ++; - print "$_\n"; - } - print "Sum: $Param->{AllCount} table scans\n"; - - print "\nSummary ---------------------------------------\n\n"; - print "Select: \t$Param->{SelectCount} queries\n"; - print "Update: \t$Param->{UpdateCount} queries\n"; - print "\n"; - - print "Init: \t$Param->{Init} times\n"; - print "Field: \t$Param->{Field} times\n"; - print "Refresh: \t$Param->{Refresh} times\n"; - print "Query: \t$Param->{QueryCount} times\n"; - print "Statistics:\t$Param->{Statistics} times\n"; - print "\n"; - - print "Logfile: \t$Param->{LineCount} lines\n"; - print "Started: \t".localtime($Param->{Start})."\n"; - print "Finished: \t".localtime(time)."\n"; - - } -} - - -########################################################################### -# -# -# -sub RunQuery { - my $Param = shift ; - - if (defined $Param->{Query}) { - if (defined $Param->{DB} ) { - - $Param->{Query} =~ m/from\s+(\w+[.]\w+|\w+)/i; - $Param->{tab} =$1; - #print "||$Param->{tab} -- $Param->{Query}\n"; - - my $sth=$Param->{dbh}->prepare("USE $Param->{DB}"); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - $sth->execute(); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - $sth->finish(); - - $sth=$Param->{dbh}->prepare($Param->{Query}); - if (DBI::err()) { - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - #print "$Param->{Query}\n"; - $sth->execute(); - if (DBI::err()) { - if ($Param->{PrintError}) {print "[$Param->{LineCount}]<<$Param->{Query}>>\n";} - if ($Param->{PrintError}) {print "Error: ".DBI::errstr()."\n";} - } - else { - my $row = undef; - while ($row = $sth->fetchrow_hashref()) { - $Param->{SelectCount} ++; - - if (defined $row->{Comment}) { - push (@{$Param->{Comment}}, "$row->{Comment}; $_; $Param->{DB}; $Param->{Query}"); - } - foreach (@{$Param->{Rows}}) { - if (defined $row->{$_}) { - #if (($_ eq 'type' ) and ($row->{$_} eq 'ALL')) { - if ($row->{type} eq 'ALL') { - push (@{$Param->{ALL}}, "$Param->{Query}"); - #print ">> $row->{$_} $_ $Param->{DB} $Param->{Query}\n"; - } - $Param->{IdxUseCount} ++; - $Param->{Data}->{$Param->{tab}}->{$_}->{$row->{$_}} ++; - } - } - } - } - } - } - } - $sth->finish(); - } - $Param->{Query} = undef ; - } -} - -########################################################################### -# -# -# -sub ShowOptions { - print <, http://www.mobile.de - Dennis Haney (Added socket support) - -=head1 RECRUITING - -If you are looking for a MySQL or Perl job, take a look at http://www.mobile.de -and send me an email with your resume (you must be speaking German!). - -=head1 SEE ALSO - -mysql documentation - -=cut diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 6c0565c51cf..01746d3156e 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -554,7 +554,6 @@ fi %attr(755, root, root) %{_bindir}/myisampack %attr(755, root, root) %{_bindir}/mysql_convert_table_format %attr(755, root, root) %{_bindir}/mysql_create_system_tables -%attr(755, root, root) %{_bindir}/mysql_explain_log %attr(755, root, root) %{_bindir}/mysql_fix_extensions %attr(755, root, root) %{_bindir}/mysql_fix_privilege_tables %attr(755, root, root) %{_bindir}/mysql_install_db From 8bd23f0725d90652c13c967723e0cce67fd97a64 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 May 2006 17:51:17 -0700 Subject: [PATCH 12/13] Fix events_logs_tests so it won't fail on Windows due to appearance of hostname in query results. mysql-test/r/events_logs_tests.result: Update results mysql-test/t/events_logs_tests.test: Replace user_host in results, since it is system dependent. --- mysql-test/r/events_logs_tests.result | 6 +++--- mysql-test/t/events_logs_tests.test | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result index 911bc8b2d60..ce58e0ec059 100644 --- a/mysql-test/r/events_logs_tests.result +++ b/mysql-test/r/events_logs_tests.result @@ -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; diff --git a/mysql-test/t/events_logs_tests.test b/mysql-test/t/events_logs_tests.test index a468685ddc6..6d3b3292630 100644 --- a/mysql-test/t/events_logs_tests.test +++ b/mysql-test/t/events_logs_tests.test @@ -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; From 59c2b9702df8d53ed7d7394e822489fcba223868 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 May 2006 09:28:37 +0200 Subject: [PATCH 13/13] Fix missing source file. --- sql/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/Makefile.am b/sql/Makefile.am index eec7209bf50..7f711a1e212 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -66,7 +66,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ parse_file.h sql_view.h sql_trigger.h \ sql_array.h sql_cursor.h event.h event_priv.h \ sql_plugin.h authors.h sql_partition.h \ - partition_info.h partition_element.h event_scheduler.h + partition_info.h partition_element.h event_scheduler.h \ + contributors.h mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \ item.cc item_sum.cc item_buff.cc item_func.cc \ item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \