From 640287b3bf6ca51695fcd465fbdd27f9bc8884a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Dec 2004 02:26:22 +0300 Subject: [PATCH 1/9] Fix for BUG#5401 (attempt 2) innobase/row/row0sel.c: Fix for BUG#5401: Don't reset the entire NULL mask, only set/clear bits for particular fields. This is necessary because index_merge ROR-intersection uses simulatenous scans on several keys with the same row buffer. mysql-test/r/index_merge_innodb.result: Test for BUG#5401 mysql-test/t/index_merge_innodb.test: Test for BUG#5401 --- innobase/row/row0sel.c | 18 ++++--- mysql-test/r/index_merge_innodb.result | 68 ++++++++++++++++++++++++++ mysql-test/t/index_merge_innodb.test | 68 ++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 7 deletions(-) diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index a3d844d1dac..148a5ddf043 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2331,11 +2331,6 @@ row_sel_store_mysql_rec( prebuilt->blob_heap = NULL; } - /* MySQL assumes that all columns have the SQL NULL bit set unless it - is a nullable column with a non-NULL value */ - - memset(mysql_rec, 0xFF, prebuilt->null_bitmap_len); - for (i = 0; i < prebuilt->n_template; i++) { templ = prebuilt->mysql_template + i; @@ -2431,6 +2426,8 @@ row_sel_store_mysql_rec( bug number 154 in the MySQL bug database: GROUP BY and DISTINCT could treat NULL values inequal. */ + mysql_rec[templ->mysql_null_byte_offset] |= + (byte) (templ->mysql_null_bit_mask); if (templ->type == DATA_VARCHAR || templ->type == DATA_CHAR || templ->type == DATA_BINARY @@ -2734,6 +2731,7 @@ row_sel_pop_cached_row_for_mysql( ulint i; mysql_row_templ_t* templ; byte* cached_rec; + byte null_byte; ut_ad(prebuilt->n_fetch_cached > 0); if (prebuilt->keep_other_fields_on_keyread) @@ -2749,10 +2747,16 @@ row_sel_pop_cached_row_for_mysql( buf + templ->mysql_col_offset, cached_rec + templ->mysql_col_offset, templ->mysql_col_len); - + /* Copy NULL bit of the current field from cached_rec + to buf */ if (templ->mysql_null_bit_mask) - buf[templ->mysql_null_byte_offset] &= + { + null_byte = buf[templ->mysql_null_byte_offset] & + ~(byte)templ->mysql_null_bit_mask; + null_byte |= (byte)templ->mysql_null_bit_mask & cached_rec[templ->mysql_null_byte_offset]; + buf[templ->mysql_null_byte_offset] = null_byte; + } } } else diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result index afa17c79a6e..d1914844839 100644 --- a/mysql-test/r/index_merge_innodb.result +++ b/mysql-test/r/index_merge_innodb.result @@ -53,3 +53,71 @@ key1 key2 str1 zeroval str2 str3 1 199 aaa 0 bbb 199-0_A 0 200 aaa 0 bbb 200-0_a drop table t1; +create table t1 ( +pk integer not null auto_increment primary key, +key1 integer, +key2 integer not null, +filler char (200), +index (key1), +index (key2) +) engine=innodb; +show warnings; +Level Code Message +explain select pk from t1 where key1 = 1 and key2 = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge key1,key2 key1,key2 5,4 NULL 1 Using intersect(key1,key2); Using where; Using index +select pk from t1 where key2 = 1 and key1 = 1; +pk +26 +select pk from t1 ignore index(key1,key2) where key2 = 1 and key1 = 1; +pk +26 +drop table t1; +create table t1 ( +pk int primary key auto_increment, +key1a int, +key2a int, +key1b int, +key2b int, +dummy1 int, +dummy2 int, +dummy3 int, +dummy4 int, +key3a int, +key3b int, +filler1 char (200), +index i1(key1a, key1b), +index i2(key2a, key2b), +index i3(key3a, key3b) +) engine=innodb; +create table t2 (a int); +insert into t2 values (0),(1),(2),(3),(4),(NULL); +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) +select A.a, B.a, C.a, D.a, C.a, D.a from t2 A,t2 B,t2 C, t2 D; +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) +select key1a, key1b, key2a, key2b, key3a, key3b from t1; +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) +select key1a, key1b, key2a, key2b, key3a, key3b from t1; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +select count(*) from t1; +count(*) +5184 +explain select count(*) from t1 where +key1a = 2 and key1b is null and key2a = 2 and key2b is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 3 Using intersect(i1,i2); Using where; Using index +select count(*) from t1 where +key1a = 2 and key1b is null and key2a = 2 and key2b is null; +count(*) +4 +explain select count(*) from t1 where +key1a = 2 and key1b is null and key3a = 2 and key3b is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 3 Using intersect(i1,i3); Using where; Using index +select count(*) from t1 where +key1a = 2 and key1b is null and key3a = 2 and key3b is null; +count(*) +4 +drop table t1,t2; diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test index 2da40c5719a..cc1a3169d0e 100644 --- a/mysql-test/t/index_merge_innodb.test +++ b/mysql-test/t/index_merge_innodb.test @@ -51,4 +51,72 @@ select * from t1 where key1 < 5 or key2 > 197; explain select * from t1 where key1 < 3 or key2 > 195; select * from t1 where key1 < 3 or key2 > 195; +# Test for BUG#5401 drop table t1; +create table t1 ( + pk integer not null auto_increment primary key, + key1 integer, + key2 integer not null, + filler char (200), + index (key1), + index (key2) +) engine=innodb; +show warnings; +--disable_query_log +let $1=30; +while ($1) +{ + eval insert into t1 (key1, key2, filler) values ($1/4, $1/8, 'filler-data'); + dec $1; +} +--enable_query_log +explain select pk from t1 where key1 = 1 and key2 = 1; +select pk from t1 where key2 = 1 and key1 = 1; +select pk from t1 ignore index(key1,key2) where key2 = 1 and key1 = 1; + +# More tests for BUG#5401. +drop table t1; +create table t1 ( + pk int primary key auto_increment, + key1a int, + key2a int, + key1b int, + key2b int, + dummy1 int, + dummy2 int, + dummy3 int, + dummy4 int, + key3a int, + key3b int, + filler1 char (200), + index i1(key1a, key1b), + index i2(key2a, key2b), + index i3(key3a, key3b) +) engine=innodb; + +create table t2 (a int); +insert into t2 values (0),(1),(2),(3),(4),(NULL); + +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) + select A.a, B.a, C.a, D.a, C.a, D.a from t2 A,t2 B,t2 C, t2 D; +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) + select key1a, key1b, key2a, key2b, key3a, key3b from t1; +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) + select key1a, key1b, key2a, key2b, key3a, key3b from t1; +analyze table t1; +select count(*) from t1; + +explain select count(*) from t1 where + key1a = 2 and key1b is null and key2a = 2 and key2b is null; + +select count(*) from t1 where + key1a = 2 and key1b is null and key2a = 2 and key2b is null; + +explain select count(*) from t1 where + key1a = 2 and key1b is null and key3a = 2 and key3b is null; + +select count(*) from t1 where + key1a = 2 and key1b is null and key3a = 2 and key3b is null; + +drop table t1,t2; + From 9f62dcfd070361d5f6410ea213c316e71b5ecf50 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Dec 2004 15:23:39 +0300 Subject: [PATCH 2/9] Make index_merge code call handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) if it will call handler::position() during key scan. Undo the previous, less efficient fix (cset 2004-11-30 19:56:25+02:00, heikki@hundin.mysql.fi) innobase/include/row0mysql.h: undo cset 1.1698.1.2 sql/ha_innodb.cc: undo cset 1.1698.1.2 sql/opt_range.cc: Make index_merge code call file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) if file->position() will be called. Also fixed a typo and added a couple of error checks. --- innobase/include/row0mysql.h | 8 +------- sql/ha_innodb.cc | 8 +------- sql/opt_range.cc | 10 ++++++---- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index c23a0e025ad..ea6d26b46fa 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -549,10 +549,7 @@ struct row_prebuilt_struct { format */ ulint hint_need_to_fetch_extra_cols; /* normally this is set to 0; if this - is set to ROW_RETRIEVE_PRIMARY_KEY - (that value is obsolete starting from - 5.0.2, because we always fetch the - primary key cols), + is set to ROW_RETRIEVE_PRIMARY_KEY, then we should at least retrieve all columns in the primary key; if this is set to ROW_RETRIEVE_ALL_COLS, then @@ -625,9 +622,6 @@ struct row_prebuilt_struct { /* Values for hint_need_to_fetch_extra_cols */ #define ROW_RETRIEVE_PRIMARY_KEY 1 - /* value 1 is obsolete starting from - 5.0.2, because we always fetch the - primary key cols */ #define ROW_RETRIEVE_ALL_COLS 2 diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index cb23e31225b..bc6fd1dfeff 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2275,13 +2275,7 @@ build_template( ulint n_fields; ulint n_requested_fields = 0; ibool fetch_all_in_key = FALSE; - ibool fetch_primary_key_cols = TRUE; /* The ROR code in - opt_range.cc assumes that the - primary key cols are always - retrieved. Starting from - MySQL-5.0.2, let us always - fetch them, even though it - wastes some CPU. */ + ibool fetch_primary_key_cols = FALSE; ulint i; if (prebuilt->select_lock_type == LOCK_X) { diff --git a/sql/opt_range.cc b/sql/opt_range.cc index e47c7e147a7..11a99712de2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -897,7 +897,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) { DBUG_PRINT("info", ("Reusing handler %p", file)); if (file->extra(HA_EXTRA_KEYREAD) || - file->extra(HA_EXTRA_RETRIEVE_ALL_COLS) | + file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) || init() || reset()) { DBUG_RETURN(1); @@ -922,7 +922,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) } if (file->extra(HA_EXTRA_KEYREAD) || - file->extra(HA_EXTRA_RETRIEVE_ALL_COLS) || + file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) || init() || reset()) { file->close(); @@ -5600,7 +5600,8 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge() DBUG_ENTER("QUICK_INDEX_MERGE_SELECT::prepare_unique"); /* We're going to just read rowids. */ - head->file->extra(HA_EXTRA_KEYREAD); + if (head->file->extra(HA_EXTRA_KEYREAD)) + DBUG_RETURN(1); /* Make innodb retrieve all PK member fields, so @@ -5609,7 +5610,8 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge() (This also creates a deficiency - it is possible that we will retrieve parts of key that are not used by current query at all.) */ - head->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); + if (head->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY)) + DBUG_RETURN(1); cur_quick_it.rewind(); cur_quick= cur_quick_it++; From 9755b5e5f3e4fc6b9bd1f4aab17195afd04c4535 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 22:34:54 -0600 Subject: [PATCH 3/9] mysqld.cc: Fix out-of-order option. sql/mysqld.cc: Fix out-of-order option. --- sql/mysqld.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index dd7fd98158a..2797ab0463b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4415,6 +4415,9 @@ Disable with --skip-large-pages.", Disable with --skip-innodb (will save memory).", (gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, OPT_INNODB_DEFAULT, 0, 0, 0, 0, 0}, + {"innodb_checksums", OPT_INNODB_CHECKSUMS, "Enable InnoDB checksums validation (enabled by default). \ +Disable with --skip-innodb-checksums.", (gptr*) &innobase_use_checksums, + (gptr*) &innobase_use_checksums, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"innodb_data_file_path", OPT_INNODB_DATA_FILE_PATH, "Path to individual files and their sizes.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -4426,9 +4429,6 @@ Disable with --skip-innodb (will save memory).", {"innodb_doublewrite", OPT_INNODB_DOUBLEWRITE, "Enable InnoDB doublewrite buffer (enabled by default). \ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, (gptr*) &innobase_use_doublewrite, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"innodb_checksums", OPT_INNODB_CHECKSUMS, "Enable InnoDB checksums validation (enabled by default). \ -Disable with --skip-innodb-checksums.", (gptr*) &innobase_use_checksums, - (gptr*) &innobase_use_checksums, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"innodb_fast_shutdown", OPT_INNODB_FAST_SHUTDOWN, "Speeds up server shutdown process.", (gptr*) &innobase_fast_shutdown, (gptr*) &innobase_fast_shutdown, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, From c8807157ff00f53851039a8a030b411eb1822e75 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 08:39:15 +0300 Subject: [PATCH 4/9] BUG#5401: post-review fixes --- innobase/row/row0sel.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 148a5ddf043..35f4b298e02 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2731,7 +2731,6 @@ row_sel_pop_cached_row_for_mysql( ulint i; mysql_row_templ_t* templ; byte* cached_rec; - byte null_byte; ut_ad(prebuilt->n_fetch_cached > 0); if (prebuilt->keep_other_fields_on_keyread) @@ -2747,15 +2746,14 @@ row_sel_pop_cached_row_for_mysql( buf + templ->mysql_col_offset, cached_rec + templ->mysql_col_offset, templ->mysql_col_len); - /* Copy NULL bit of the current field from cached_rec + /* Copy NULL bit of the current field from cached_rec to buf */ if (templ->mysql_null_bit_mask) { - null_byte = buf[templ->mysql_null_byte_offset] & - ~(byte)templ->mysql_null_bit_mask; - null_byte |= (byte)templ->mysql_null_bit_mask & - cached_rec[templ->mysql_null_byte_offset]; - buf[templ->mysql_null_byte_offset] = null_byte; + buf[templ->mysql_null_byte_offset] ^= + (buf[templ->mysql_null_byte_offset] ^ + cached_rec[templ->mysql_null_byte_offset]) & + (byte)templ->mysql_null_bit_mask; } } } From ec459b583b6281f6c918e8d56d7ca9316ddfa5c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 22:55:10 +0200 Subject: [PATCH 5/9] Minor clean up. mysql-test/t/analyse.test: Added a note about the bug that this test case tests. sql/sql_analyse.cc: Changed function description to standard format. --- mysql-test/t/analyse.test | 5 +++++ sql/sql_analyse.cc | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 34343c2b7bf..52e367769a2 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -38,6 +38,11 @@ select * from t2; insert into t2 select * from t1 procedure analyse(); select * from t2; drop table t1,t2; + +# +# Bug#2813 - analyse does not quote string values in enums from string +# + create table t1 (v varchar(128)); insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); select * from t1 procedure analyse(); diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 5265857f3b1..33ce62bc5cf 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -1029,20 +1029,19 @@ uint check_ulonglong(const char *str, uint length) } /* check_ulonlong */ - /* - FUNCTION: append_escaped() - + Quote special characters in a string. + + SYNOPSIS + append_escaped(to_str, from_str) + to_str (in) A pointer to a String. + from_str (to) A pointer to an allocated string + DESCRIPTION append_escaped() takes a String type variable, where it appends escaped the second argument. Only characters that require escaping will be escaped. - ARGUMENTS - A pointer to a String variable, where results will be appended - A pointer to a String variable, which is appended to the result - String, escaping those characters that require it. - RETURN VALUES 0 Success 1 Out of memory From 069d260b0ea1bd77d1f8c31f2b137dd809830858 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 02:13:19 +0300 Subject: [PATCH 6/9] Add logging of COM_EXECUTE in the general query log. sql/sql_parse.cc: A shorter name for COM_EXECUTE command. --- sql/sql_parse.cc | 2 +- sql/sql_prepare.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2b273f4b84c..4d802ad4f34 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -64,7 +64,7 @@ const char *command_name[]={ "Drop DB", "Refresh", "Shutdown", "Statistics", "Processlist", "Connect","Kill","Debug","Ping","Time","Delayed insert","Change user", "Binlog Dump","Table Dump", "Connect Out", "Register Slave", - "Prepare", "Prepare Execute", "Long Data", "Close stmt", + "Prepare", "Execute", "Long Data", "Close stmt", "Reset stmt", "Set option", "Error" // Last command number }; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 20ebc23e240..ecf01824755 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1592,7 +1592,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, DBUG_RETURN(1); } - mysql_log.write(thd, COM_PREPARE, "%s", packet); + mysql_log.write(thd, COM_PREPARE, "[%lu] %s", stmt->id, packet); thd->current_arena= stmt; mysql_init_query(thd, (uchar *) thd->query, thd->query_length); @@ -1792,6 +1792,9 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) if (stmt->param_count && stmt->set_params_data(stmt, &expanded_query)) goto set_params_data_err; #endif + mysql_log.write(thd, COM_EXECUTE, "[%lu] %s", stmt->id, + expanded_query.length() ? expanded_query.c_ptr() : + stmt->query); thd->protocol= &thd->protocol_prep; // Switch to binary protocol execute_stmt(thd, stmt, &expanded_query, TRUE); thd->protocol= &thd->protocol_simple; // Use normal protocol From c26f341bb97b80fbaaa796dddcd24e2ae9c21b4d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 19:56:49 -0600 Subject: [PATCH 7/9] libmysqld.def, libmysql.def: Add missing 'get_defaults_files' to fix linking error. libmysql/libmysql.def: Add missing 'get_defaults_files' to fix linking error. libmysqld/libmysqld.def: Add missing 'get_defaults_files' to fix linking error. --- libmysql/libmysql.def | 1 + libmysqld/libmysqld.def | 1 + 2 files changed, 2 insertions(+) diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index c9ff70f208d..6967b09b143 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -146,3 +146,4 @@ EXPORTS mysql_rpl_query_type mysql_slave_query mysql_embedded + get_defaults_files diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index 14c6725bcb5..5515f50a1de 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -157,3 +157,4 @@ EXPORTS mysql_stmt_attr_get mysql_stmt_attr_set mysql_stmt_field_count + get_defaults_files From c73762dbdfa67c82c7887a0b3be9d1a0f5602bdf Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 20:38:05 -0600 Subject: [PATCH 8/9] user_limits.result: Fix test result affected by error message rewording. errmsg.txt: Reword error messages. set_var.cc: Reorder variables. mysqld.cc: Reorder options. sql/mysqld.cc: Reorder options. sql/set_var.cc: Reorder variables. sql/share/errmsg.txt: Reword error messages. mysql-test/r/user_limits.result: Fix test result affected by error message rewording. --- mysql-test/r/user_limits.result | 2 +- sql/mysqld.cc | 22 +++++++++++----------- sql/set_var.cc | 8 ++++---- sql/share/errmsg.txt | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/user_limits.result b/mysql-test/r/user_limits.result index ec7adcdfe3c..b374b05e3f0 100644 --- a/mysql-test/r/user_limits.result +++ b/mysql-test/r/user_limits.result @@ -77,7 +77,7 @@ select @@session.max_user_connections, @@global.max_user_connections; select * from t1; i connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK); -ERROR 42000: User mysqltest_1 has already more than 'max_user_connections' active connections +ERROR 42000: User mysqltest_1 already has more than 'max_user_connections' active connections grant usage on *.* to mysqltest_1@localhost with max_user_connections 3; select @@session.max_user_connections, @@global.max_user_connections; @@session.max_user_connections @@global.max_user_connections diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d511d585828..a3f10d5c045 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5016,6 +5016,12 @@ log and this option does nothing anymore.", "The size of the memory buffer InnoDB uses to cache data and indexes of its tables.", (gptr*) &innobase_buffer_pool_size, (gptr*) &innobase_buffer_pool_size, 0, GET_LONG, REQUIRED_ARG, 8*1024*1024L, 1024*1024L, ~0L, 0, 1024*1024L, 0}, + {"innodb_concurrency_tickets", OPT_INNODB_CONCURRENCY_TICKETS, + "Number of times a thread is allowed to enter InnoDB within the same \ + SQL query after it has once got the ticket", + (gptr*) &srv_n_free_tickets_to_enter, + (gptr*) &srv_n_free_tickets_to_enter, + 0, GET_LONG, REQUIRED_ARG, 500L, 1L, ~0L, 0, 1L, 0}, {"innodb_file_io_threads", OPT_INNODB_FILE_IO_THREADS, "Number of file I/O threads in InnoDB.", (gptr*) &innobase_file_io_threads, (gptr*) &innobase_file_io_threads, 0, GET_LONG, REQUIRED_ARG, 4, 4, 64, 0, @@ -5049,17 +5055,6 @@ log and this option does nothing anymore.", "How many files at the maximum InnoDB keeps open at the same time.", (gptr*) &innobase_open_files, (gptr*) &innobase_open_files, 0, GET_LONG, REQUIRED_ARG, 300L, 10L, ~0L, 0, 1L, 0}, - {"innodb_sync_spin_loops", OPT_INNODB_SYNC_SPIN_LOOPS, - "Count of spin-loop rounds in InnoDB mutexes", - (gptr*) &srv_n_spin_wait_rounds, - (gptr*) &srv_n_spin_wait_rounds, - 0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0}, - {"innodb_concurrency_tickets", OPT_INNODB_CONCURRENCY_TICKETS, - "Number of times a thread is allowed to enter InnoDB within the same \ - SQL query after it has once got the ticket", - (gptr*) &srv_n_free_tickets_to_enter, - (gptr*) &srv_n_free_tickets_to_enter, - 0, GET_LONG, REQUIRED_ARG, 500L, 1L, ~0L, 0, 1L, 0}, #ifdef HAVE_REPLICATION /* Disabled for the 4.1.3 release. Disabling just this paragraph of code is @@ -5080,6 +5075,11 @@ log and this option does nothing anymore.", 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, #endif #endif + {"innodb_sync_spin_loops", OPT_INNODB_SYNC_SPIN_LOOPS, + "Count of spin-loop rounds in InnoDB mutexes", + (gptr*) &srv_n_spin_wait_rounds, + (gptr*) &srv_n_spin_wait_rounds, + 0, GET_LONG, REQUIRED_ARG, 20L, 0L, ~0L, 0, 1L, 0}, {"innodb_thread_concurrency", OPT_INNODB_THREAD_CONCURRENCY, "Helps in performance tuning in heavily concurrent environments.", (gptr*) &srv_thread_concurrency, (gptr*) &srv_thread_concurrency, diff --git a/sql/set_var.cc b/sql/set_var.cc index a0ec68098cb..957cacc91ac 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -750,11 +750,11 @@ struct show_var_st init_vars[]= { {sys_innodb_autoextend_increment.name, (char*) &sys_innodb_autoextend_increment, SHOW_SYS}, {"innodb_buffer_pool_awe_mem_mb", (char*) &innobase_buffer_pool_awe_mem_mb, SHOW_LONG }, {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG }, + {"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL}, + {sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS}, {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR}, {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR}, {"innodb_doublewrite", (char*) &innobase_use_doublewrite, SHOW_MY_BOOL}, - {"innodb_checksums", (char*) &innobase_use_checksums, SHOW_MY_BOOL}, - {sys_innodb_concurrency_tickets.name, (char*) &sys_innodb_concurrency_tickets, SHOW_SYS}, {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL}, {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL}, @@ -773,10 +773,10 @@ struct show_var_st init_vars[]= { {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS}, {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG }, - {sys_innodb_thread_concurrency.name, (char*) &sys_innodb_thread_concurrency, SHOW_SYS}, - {sys_innodb_thread_sleep_delay.name, (char*) &sys_innodb_thread_sleep_delay, SHOW_SYS}, {sys_innodb_sync_spin_loops.name, (char*) &sys_innodb_sync_spin_loops, SHOW_SYS}, {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS}, + {sys_innodb_thread_concurrency.name, (char*) &sys_innodb_thread_concurrency, SHOW_SYS}, + {sys_innodb_thread_sleep_delay.name, (char*) &sys_innodb_thread_sleep_delay, SHOW_SYS}, #endif {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS}, {sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS}, diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 5b48f27d2e3..b8ef5c413d8 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -4266,7 +4266,7 @@ ER_SLAVE_THREAD ER_TOO_MANY_USER_CONNECTIONS 42000 dan "Brugeren %-.64s har allerede mere end 'max_user_connections' aktive forbindelser" nla "Gebruiker %-.64s heeft reeds meer dan 'max_user_connections' actieve verbindingen" - eng "User %-.64s has already more than 'max_user_connections' active connections" + eng "User %-.64s already has more than 'max_user_connections' active connections" est "Kasutajal %-.64s on juba rohkem ühendusi kui lubatud 'max_user_connections' muutujaga" fre "L'utilisateur %-.64s possède déjà plus de 'max_user_connections' connections actives" ger "Benutzer '%-.64s' hat mehr als max_user_connections aktive Verbindungen" @@ -4764,7 +4764,7 @@ ER_SLAVE_WAS_RUNNING spa "Slave ya está funcionando" swe "Slaven har redan startat" ER_SLAVE_WAS_NOT_RUNNING - eng "Slave has already been stopped" + eng "Slave already has been stopped" ger "Slave wurde bereits angehalten" por "O slave já está parado" spa "Slave ya fué parado" From 8191a28b9754eb145cd8c2556ae47a4399a8fe72 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 21:04:31 -0600 Subject: [PATCH 9/9] libmysqld.def, libmysql.def: Use the invisible tabs (!) libmysql/libmysql.def: Use the invisible tabs (!) libmysqld/libmysqld.def: Use the invisible tabs (!) --- libmysql/libmysql.def | 2 +- libmysqld/libmysqld.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index 6967b09b143..c5579e9ec2b 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -146,4 +146,4 @@ EXPORTS mysql_rpl_query_type mysql_slave_query mysql_embedded - get_defaults_files + get_defaults_files diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index 5515f50a1de..ea3133594f5 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -157,4 +157,4 @@ EXPORTS mysql_stmt_attr_get mysql_stmt_attr_set mysql_stmt_field_count - get_defaults_files + get_defaults_files