From 12c42b980aa94105a9108d4f58c5dc75d96ec824 Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Mon, 16 May 2011 22:04:01 +0200 Subject: Fix for BUG#11755168 '46895: test "outfile_loaddata" fails (reproducible)'. In sql_class.cc, 'row_count', of type 'ha_rows', was used as last argument for ER_TRUNCATED_WRONG_VALUE_FOR_FIELD which is "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %ld". So 'ha_rows' was used as 'long'. On SPARC32 Solaris builds, 'long' is 4 bytes and 'ha_rows' is 'longlong' i.e. 8 bytes. So the printf-like code was reading only the first 4 bytes. Because the CPU is big-endian, 1LL is 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x01 so the first four bytes yield 0. So the warning message had "row 0" instead of "row 1" in test outfile_loaddata.test: -Warning 1366 Incorrect string value: '\xE1\xE2\xF7' for column 'b' at row 1 +Warning 1366 Incorrect string value: '\xE1\xE2\xF7' for column 'b' at row 0 All error-messaging functions which internally invoke some printf-life function are potential candidate for such mistakes. One apparently easy way to catch such mistakes is to use ATTRIBUTE_FORMAT (from my_attribute.h). But this works only when call site has both: a) the format as a string literal b) the types of arguments. So: func(ER(ER_BLAH), 10); will silently not be checked, because ER(ER_BLAH) is not known at compile time (it is known at run-time, and depends on the chosen language). And func("%s", a va_list argument); has the same problem, as the *real* type of arguments is not known at this site at compile time (it's known in some caller). Moreover, func(ER(ER_BLAH)); though possibly correct (if ER(ER_BLAH) has no '%' markers), will not compile (gcc says "error: format not a string literal and no format arguments"). Consequences: 1) ATTRIBUTE_FORMAT is here added only to functions which in practice take "string literal" formats: "my_error_reporter" and "print_admin_msg". 2) it cannot be added to the other functions: my_error(), push_warning_printf(), Table_check_intact::report_error(), general_log_print(). To do a one-time check of functions listed in (2), the following "static code analysis" has been done: 1) replace my_error(ER_xxx, arguments for substitution in format) with the equivalent my_printf_error(ER_xxx,ER(ER_xxx), arguments for substitution in format), so that we have ER(ER_xxx) and the arguments *in the same call site* 2) add ATTRIBUTE_FORMAT to push_warning_printf(), Table_check_intact::report_error(), general_log_print() 3) replace ER(xxx) with the hard-coded English text found in errmsg.txt (like: ER(ER_UNKNOWN_ERROR) is replaced with "Unknown error"), so that a call site has the format as string literal 4) this way, ATTRIBUTE_FORMAT can effectively do its job 5) compile, fix errors detected by ATTRIBUTE_FORMAT 6) revert steps 1-2-3. The present patch has no compiler error when submitted again to the static code analysis above. It cannot catch all problems though: see Field::set_warning(), in which a call to push_warning_printf() has a variable error (thus, not replacable by a string literal); I checked set_warning() calls by hand though. See also WL 5883 for one proposal to avoid such bugs from appearing again in the future. The issues fixed in the patch are: a) mismatch in types (like 'int' passed to '%ld') b) more arguments passed than specified in the format. This patch resolves mismatches by changing the type/number of arguments, not by changing error messages of sql/share/errmsg.txt. The latter would be wrong, per the following old rule: errmsg.txt must be as stable as possible; no insertions or deletions of messages, no changes of type or number of printf-like format specifiers, are allowed, as long as the change impacts a message already released in a GA version. If this rule is not followed: - Connectors, which use error message numbers, will be confused (by insertions/deletions of messages) - using errmsg.sys of MySQL 5.1.n with mysqld of MySQL 5.1.(n+1) could produce wrong messages or crash; such usage can easily happen if installing 5.1.(n+1) while /etc/my.cnf still has --language=/path/to/5.1.n/xxx; or if copying mysqld from 5.1.(n+1) into a 5.1.n installation. When fixing b), I have verified that the superfluous arguments were not used in the format in the first 5.1 GA (5.1.30 'bteam@astra04-20081114162938-z8mctjp6st27uobm'). Had they been used, then passing them today, even if the message doesn't use them anymore, would have been necessary, as explained above. include/my_getopt.h: this function pointer is used only with "string literal" formats, so we can add ATTRIBUTE_FORMAT. mysql-test/collections/default.experimental: test should pass now sql/derror.cc: by having a format as string literal, ATTRIBUTE_FORMAT check becomes effective. sql/events.cc: Change justified by the following excerpt from sql/share/errmsg.txt: ER_EVENT_SAME_NAME eng "Same old and new event name" ER_EVENT_SET_VAR_ERROR eng "Error during starting/stopping of the scheduler. Error code %u" sql/field.cc: ER_TOO_BIG_SCALE 42000 S1009 eng "Too big scale %d specified for column '%-.192s'. Maximum is %lu." ER_TOO_BIG_PRECISION 42000 S1009 eng "Too big precision %d specified for column '%-.192s'. Maximum is %lu." ER_TOO_BIG_DISPLAYWIDTH 42000 S1009 eng "Display width out of range for column '%-.192s' (max = %lu)" sql/ha_ndbcluster.cc: ER_OUTOFMEMORY HY001 S1001 eng "Out of memory; restart server and try again (needed %d bytes)" (sizeof() returns size_t) sql/ha_ndbcluster_binlog.cc: Too many arguments for: ER_GET_ERRMSG eng "Got error %d '%-.100s' from %s" Patch by Jonas Oreland. sql/ha_partition.cc: print_admin_msg() is used only with a literal as format, so ATTRIBUTE_FORMAT works. sql/handler.cc: ER_OUTOFMEMORY HY001 S1001 eng "Out of memory; restart server and try again (needed %d bytes)" (sizeof() returns size_t) sql/item_create.cc: ER_TOO_BIG_SCALE 42000 S1009 eng "Too big scale %d specified for column '%-.192s'. Maximum is %lu." ER_TOO_BIG_PRECISION 42000 S1009 eng "Too big precision %d specified for column '%-.192s'. Maximum is %lu." 'c_len' and 'c_dec' are char*, passed as %d !! We don't know their value (as strtoul() failed), but they are likely big, so we use INT_MAX. 'len' is ulong. sql/item_func.cc: ER_WARN_DATA_OUT_OF_RANGE 22003 eng "Out of range value for column '%s' at row %ld" ER_CANT_FIND_UDF eng "Can't load function '%-.192s'" sql/item_strfunc.cc: ER_TOO_BIG_FOR_UNCOMPRESS eng "Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)" max_allowed_packet is ulong. sql/mysql_priv.h: sql_print_message_func is a function _pointer_. sql/sp_head.cc: ER_SP_RECURSION_LIMIT eng "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192s" max_sp_recursion_depth is ulong sql/sql_acl.cc: ER_PASSWORD_NO_MATCH 42000 eng "Can't find any matching row in the user table" ER_CANT_CREATE_USER_WITH_GRANT 42000 eng "You are not allowed to create a user with GRANT" sql/sql_base.cc: ER_NOT_KEYFILE eng "Incorrect key file for table '%-.200s'; try to repair it" ER_TOO_MANY_TABLES eng "Too many tables; MySQL can only use %d tables in a join" MAX_TABLES is size_t. sql/sql_binlog.cc: ER_UNKNOWN_ERROR eng "Unknown error" sql/sql_class.cc: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD eng "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %ld" WARN_DATA_TRUNCATED 01000 eng "Data truncated for column '%s' at row %ld" sql/sql_connect.cc: ER_HANDSHAKE_ERROR 08S01 eng "Bad handshake" ER_BAD_HOST_ERROR 08S01 eng "Can't get hostname for your address" sql/sql_insert.cc: ER_WRONG_VALUE_COUNT_ON_ROW 21S01 eng "Column count doesn't match value count at row %ld" sql/sql_parse.cc: ER_WARN_HOSTNAME_WONT_WORK eng "MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work" ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT eng "Too high level of nesting for select" ER_UNKNOWN_ERROR eng "Unknown error" sql/sql_partition.cc: ER_OUTOFMEMORY HY001 S1001 eng "Out of memory; restart server and try again (needed %d bytes)" sql/sql_plugin.cc: ER_OUTOFMEMORY HY001 S1001 eng "Out of memory; restart server and try again (needed %d bytes)" sql/sql_prepare.cc: ER_OUTOFMEMORY HY001 S1001 eng "Out of memory; restart server and try again (needed %d bytes)" ER_UNKNOWN_STMT_HANDLER eng "Unknown prepared statement handler (%.*s) given to %s" length value (for '%.*s') must be 'int', per the doc of printf() and the code of my_vsnprintf(). sql/sql_show.cc: ER_OUTOFMEMORY HY001 S1001 eng "Out of memory; restart server and try again (needed %d bytes)" sql/sql_table.cc: ER_TOO_BIG_FIELDLENGTH 42000 S1009 eng "Column length too big for column '%-.192s' (max = %lu); use BLOB or TEXT instead" sql/table.cc: ER_NOT_FORM_FILE eng "Incorrect information in file: '%-.200s'" ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error." table->s->mysql_version is ulong. sql/unireg.cc: ER_TOO_LONG_TABLE_COMMENT eng "Comment for table '%-.64s' is too long (max = %lu)" ER_TOO_LONG_FIELD_COMMENT eng "Comment for field '%-.64s' is too long (max = %lu)" ER_TOO_BIG_ROWSIZE 42000 eng "Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs" --- mysql-test/collections/default.experimental | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test/collections') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index fb8c6845a5f..da2df7a72e8 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -19,7 +19,6 @@ innodb_plugin.* @solaris # Bug#56063 InnoDB Plugin mysql-tests f main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists main.func_str @solaris # joro: Bug#40928 main.sp @solaris # joro : Bug#54138 -main.outfile_loaddata @solaris # joro : Bug #46895 ndb.* # joro : NDB tests marked as experimental as agreed with bochklin -- cgit v1.2.1 From faf747bf52529c03c0d8818eaa7655be897f4629 Mon Sep 17 00:00:00 2001 From: Anitha Gopi Date: Tue, 24 May 2011 09:56:24 +0530 Subject: Bug#12584161 - Moved test from disabled to experimental group --- mysql-test/collections/default.experimental | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mysql-test/collections') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index da2df7a72e8..d8acbfd03c3 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -19,6 +19,8 @@ innodb_plugin.* @solaris # Bug#56063 InnoDB Plugin mysql-tests f main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists main.func_str @solaris # joro: Bug#40928 main.sp @solaris # joro : Bug#54138 +query_cache_28249 # Bug#12584161 2009-03-25 main.query_cache_28249 fails sporadically + ndb.* # joro : NDB tests marked as experimental as agreed with bochklin -- cgit v1.2.1 From 0464f964adc65e34708b5e792bf292ec07343d7b Mon Sep 17 00:00:00 2001 From: Anitha Gopi Date: Tue, 24 May 2011 10:22:00 +0530 Subject: Bug#11756699: Move test from disabled to experimental group --- mysql-test/collections/default.experimental | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test/collections') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index d8acbfd03c3..680f05e9f24 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -19,7 +19,8 @@ innodb_plugin.* @solaris # Bug#56063 InnoDB Plugin mysql-tests f main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists main.func_str @solaris # joro: Bug#40928 main.sp @solaris # joro : Bug#54138 -query_cache_28249 # Bug#12584161 2009-03-25 main.query_cache_28249 fails sporadically +main.query_cache_28249 # Bug#12584161 2009-03-25 main.query_cache_28249 fails sporadically +main.log_tables-big # Bug#11756699 2010-11-15 mattiasj report already exists ndb.* # joro : NDB tests marked as experimental as agreed with bochklin -- cgit v1.2.1 From 099fbeb93dd8c8610e3a7ac2d60e0c542dfbe4bb Mon Sep 17 00:00:00 2001 From: Anitha Gopi Date: Tue, 24 May 2011 12:08:13 +0530 Subject: Changed to Oracle bug numbers --- mysql-test/collections/default.experimental | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'mysql-test/collections') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 680f05e9f24..9996da1dfb4 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -14,23 +14,23 @@ funcs_1.ndb* # joro : NDB tests marked as experiment funcs_2.ndb_charset # joro : NDB tests marked as experimental as agreed with bochklin -innodb_plugin.* @solaris # Bug#56063 InnoDB Plugin mysql-tests fail on Solaris +innodb_plugin.* @solaris # Bug#11763366 InnoDB Plugin mysql-tests fail on Solaris -main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists -main.func_str @solaris # joro: Bug#40928 -main.sp @solaris # joro : Bug#54138 +main.ctype_gbk_binlog @solaris # Bug#11754407: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists +main.func_str @solaris # joro: Bug#11750406 +main.sp @solaris # joro : Bug#11761625 main.query_cache_28249 # Bug#12584161 2009-03-25 main.query_cache_28249 fails sporadically main.log_tables-big # Bug#11756699 2010-11-15 mattiasj report already exists ndb.* # joro : NDB tests marked as experimental as agreed with bochklin -rpl.rpl_innodb_bug28430 @solaris # Bug#46029 -rpl.rpl_row_sp011 @solaris # Joro : Bug #45445 +rpl.rpl_innodb_bug28430 @solaris # Bug#11754425 +rpl.rpl_row_sp011 @solaris # Joro : Bug #11753919 rpl.rpl_stop_slave # Sven : BUG#12345981 rpl_ndb.* # joro : NDB tests marked as experimental as agreed with bochklin -rpl_ndb.rpl_ndb_log # Bug#38998 +rpl_ndb.rpl_ndb_log # Bug#11749433 stress.ddl_ndb # joro : NDB tests marked as experimental as agreed with bochklin @@ -48,6 +48,6 @@ parts.partition_mgm_lc1_ndb # joro : NDB tests marked as experiment parts.partition_mgm_lc2_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_syntax_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_value_ndb # joro : NDB tests marked as experimental as agreed with bochklin -main.gis-rtree # svoj: due to BUG#38965 -main.type_float # svoj: due to BUG#38965 -main.type_newdecimal # svoj: due to BUG#38965 +main.gis-rtree # svoj: due to BUG#11749418 +main.type_float # svoj: due to BUG#11749418 +main.type_newdecimal # svoj: due to BUG#11749418 -- cgit v1.2.1 From cce8a658436c2ae9052d38e7ca8c2fdf4d212b7d Mon Sep 17 00:00:00 2001 From: Anitha Gopi Date: Tue, 24 May 2011 15:46:14 +0530 Subject: BUG#12371924 # Bug is fixed. Move test out of experimental group --- mysql-test/collections/default.experimental | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test/collections') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 9996da1dfb4..cae23aa94d3 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -2,7 +2,6 @@ # in alphabetical order. This also helps with merge conflict resolution. binlog.binlog_multi_engine # joro : NDB tests marked as experimental as agreed with bochklin -binlog.binlog_bug23533 # skozlov: BUG#12371924 funcs_1.charset_collation_1 # depends on compile-time decisions -- cgit v1.2.1 From 6444fa5327623dacd1030ae0e49cb8bcda8945d9 Mon Sep 17 00:00:00 2001 From: Anitha Gopi Date: Fri, 3 Jun 2011 14:13:10 +0530 Subject: Bug#11756699 : Move test to disabled group --- mysql-test/collections/default.experimental | 1 - 1 file changed, 1 deletion(-) (limited to 'mysql-test/collections') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index cae23aa94d3..941606a37a5 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -19,7 +19,6 @@ main.ctype_gbk_binlog @solaris # Bug#11754407: main.ctype_gbk_binlog f main.func_str @solaris # joro: Bug#11750406 main.sp @solaris # joro : Bug#11761625 main.query_cache_28249 # Bug#12584161 2009-03-25 main.query_cache_28249 fails sporadically -main.log_tables-big # Bug#11756699 2010-11-15 mattiasj report already exists ndb.* # joro : NDB tests marked as experimental as agreed with bochklin -- cgit v1.2.1 From b502a64bba3143a77632042f02876086ab7dff7b Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Mon, 6 Jun 2011 13:13:54 +0300 Subject: Bug #11749418: 38965: TEST CASES GIS-RTREE, TYPE_FLOAT, TYPE_NEWDECIMAL FAIL IN EMBEDDED SERVER FreeBSD 64 bit needs the FP_X_DNML to fpsetmask() to prevent exceptions from propagating into mysql (as a threaded application). However fpsetmask() itself is deprecated in favor of fedisableexcept(). 1. Fixed the #ifdef to check for FP_X_DNML instead of i386. 2. Added a configure.in check for fedisableexcept() and, if present, this function is called insted of the fpsetmask(). No need for new tests, as the existing tests cover this already. Removed the affected tests from the experimental list. --- mysql-test/collections/default.experimental | 3 --- 1 file changed, 3 deletions(-) (limited to 'mysql-test/collections') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 941606a37a5..8883acfa606 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -46,6 +46,3 @@ parts.partition_mgm_lc1_ndb # joro : NDB tests marked as experiment parts.partition_mgm_lc2_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_syntax_ndb # joro : NDB tests marked as experimental as agreed with bochklin parts.partition_value_ndb # joro : NDB tests marked as experimental as agreed with bochklin -main.gis-rtree # svoj: due to BUG#11749418 -main.type_float # svoj: due to BUG#11749418 -main.type_newdecimal # svoj: due to BUG#11749418 -- cgit v1.2.1 From 58cf757f0b28108884fd0c9f641ba31296dc6c45 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 27 Jul 2011 12:35:44 +0200 Subject: Updated default.experimental; now rpl tests are up to date as of 2011-07-25. --- mysql-test/collections/default.experimental | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mysql-test/collections') diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 8883acfa606..961a93b8741 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -23,7 +23,8 @@ main.query_cache_28249 # Bug#12584161 2009-03-25 main.query_ca ndb.* # joro : NDB tests marked as experimental as agreed with bochklin -rpl.rpl_innodb_bug28430 @solaris # Bug#11754425 +rpl.rpl_innodb_bug28430 # Bug#11754425 +rpl.rpl_insert # Sven: BUG#12764817 rpl.rpl_row_sp011 @solaris # Joro : Bug #11753919 rpl.rpl_stop_slave # Sven : BUG#12345981 -- cgit v1.2.1