From b3fd92a242927d0b6f25f30abfdd0f04c411b83c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Mar 2012 09:27:42 +0200 Subject: Return original checksum value inside the test. Move ucs2 test in separate file (MDEV-167). --- mysql-test/suite/maria/r/maria3.result | 31 +++++-------------------------- mysql-test/suite/maria/t/maria3.test | 23 ++--------------------- 2 files changed, 7 insertions(+), 47 deletions(-) diff --git a/mysql-test/suite/maria/r/maria3.result b/mysql-test/suite/maria/r/maria3.result index 2119d9a1869..1a8ada478f6 100644 --- a/mysql-test/suite/maria/r/maria3.result +++ b/mysql-test/suite/maria/r/maria3.result @@ -393,6 +393,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +set global aria_page_checksum=0; drop table t1; set global aria_log_file_size=4294967296; Warnings: @@ -509,7 +510,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `n` int(11) NOT NULL, `c` char(1) DEFAULT NULL -) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 drop table t1; create table t1 (n int not null, c char(1)) engine=aria transactional=1; alter table t1 engine=myisam; @@ -521,7 +522,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `n` int(11) NOT NULL, `c` char(1) DEFAULT NULL -) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1 +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 TRANSACTIONAL=1 drop table t1; create table t1 (n int not null, c char(1)) engine=myisam transactional=1; Warnings: @@ -532,7 +533,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `n` int(11) NOT NULL, `c` char(1) DEFAULT NULL -) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1 +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 TRANSACTIONAL=1 drop table t1; create table t1 (a int, key(a)) transactional=0; insert into t1 values (0),(1),(2),(3),(4); @@ -645,26 +646,4 @@ a b c d e f g h i j 1 A B C D 1 M H 2 Abcdefghi E F G 2 N H drop table t1,t2; -CREATE TABLE t1 ( a VARCHAR(800),KEY(a) ) -ENGINE=Aria DEFAULT CHARACTER SET latin1; -INSERT INTO t1 VALUES -(REPEAT('abc ',200)), (REPEAT('def ',200)), -(REPEAT('ghi ',200)), (REPEAT('jkl ',200)); -INSERT INTO t1 SELECT * FROM t1; -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`; -Warnings: -Warning 1071 Specified key was too long; max key length is 1000 bytes -Warning 1071 Specified key was too long; max key length is 1000 bytes -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SHOW CREATE table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` varchar(800) CHARACTER SET ucs2 DEFAULT NULL, - KEY `a` (`a`(500)) -) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 -DROP TABLE t1; +# End of 5.1 tests diff --git a/mysql-test/suite/maria/t/maria3.test b/mysql-test/suite/maria/t/maria3.test index b36851c756b..868a21d6bfb 100644 --- a/mysql-test/suite/maria/t/maria3.test +++ b/mysql-test/suite/maria/t/maria3.test @@ -305,6 +305,7 @@ drop table t1; set global aria_page_checksum=1; create table t1 (a int); show create table t1; +set global aria_page_checksum=0; drop table t1; # @@ -554,27 +555,7 @@ INSERT INTO t2 VALUES (1,'M','','H'), SELECT * FROM t1, t2 WHERE a = g ORDER BY b; drop table t1,t2; -# End of 5.1 tests - -# -# bug#905716: Assertion `page->size <= share->max_index_block_size' -# - -CREATE TABLE t1 ( a VARCHAR(800),KEY(a) ) - ENGINE=Aria DEFAULT CHARACTER SET latin1; -INSERT INTO t1 VALUES - (REPEAT('abc ',200)), (REPEAT('def ',200)), - (REPEAT('ghi ',200)), (REPEAT('jkl ',200)); -INSERT INTO t1 SELECT * FROM t1; -# check table is not needed to reproduce the problem, -# but shows that by this time the table appears to be okay. -CHECK TABLE t1; -ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`; -CHECK TABLE t1; -SHOW CREATE table t1; -DROP TABLE t1; - -# End of 5.2 tests +--echo # End of 5.1 tests --disable_result_log --disable_query_log -- cgit v1.2.1 From cce97db8d7d7c04da8b726b3ecb0f09690ff6f1a Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 6 Mar 2012 01:46:32 +0100 Subject: LP947631: Uninstall wipes HeidiSQL settings, even if HeidiSQL is installed prior to MariaDB Fixed detection of installed HeidiSQL in the machine, prevent installing own copy if HeidiSQL is already installed. On deinstallation, do not remove settings if official HeidiSQL is detected. --- win/packaging/heidisql.wxi.in | 9 +++++++-- win/packaging/heidisql_feature.wxi.in | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/win/packaging/heidisql.wxi.in b/win/packaging/heidisql.wxi.in index 2af52862e06..1e6e3d552a8 100644 --- a/win/packaging/heidisql.wxi.in +++ b/win/packaging/heidisql.wxi.in @@ -3,7 +3,7 @@ @@ -30,11 +30,15 @@ - + + HEIDISQLINSTALLED + + + @@ -42,5 +46,6 @@ + diff --git a/win/packaging/heidisql_feature.wxi.in b/win/packaging/heidisql_feature.wxi.in index 9fceb4689d0..3f60fcd8f27 100644 --- a/win/packaging/heidisql_feature.wxi.in +++ b/win/packaging/heidisql_feature.wxi.in @@ -4,7 +4,7 @@ Description= 'Powerful, easy and free MySQL/MariaDB GUI client by Ansgar Becker' AllowAdvertise='no' Level='1'> - HEIDISQLINSTALLED + HEIDISQLINSTALLED AND NOT REMOVE ~= ALL -- cgit v1.2.1 From a8cbfd3879ddc722046ee4a591ff4e0f494aecbe Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 8 Mar 2012 22:33:01 -0800 Subject: Fixed LP bug #884175. If in the where clause of the a query some comparison conditions on the field under a MIN/MAX aggregate function contained constants whose sizes exceeded the size of the field then the query could return a wrong result when the optimizer had chosen to apply the MIN/MAX optimization. With such conditions the MIN/MAX optimization still could be applied, yet it would require a more thorough analysis of the keys built to find the value of MIN/MAX aggregate functions with index look-ups. The current patch just prohibits using the MIN/MAX optimization in this situation. --- mysql-test/r/func_group.result | 47 ++++++++++++++++++++++++++++++++++++++++++ mysql-test/t/func_group.test | 33 +++++++++++++++++++++++++++++ sql/opt_sum.cc | 10 +++++++-- 3 files changed, 88 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 3608f587572..c07d16cb3f4 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -1828,4 +1828,51 @@ NULL NULL DROP TABLE t1,t2,t3; # +# Bug #884175: MIN/MAX for short varchar = long const +# +CREATE TABLE t1 (f1 varchar(1), f2 varchar(1), KEY (f2)); +INSERT INTO t1 VALUES ('b', 'b'), ('a','a'); +EXPLAIN +SELECT MAX(f1) FROM t1 WHERE f1 = 'abc'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT MAX(f1) FROM t1 WHERE f1 = 'abc'; +MAX(f1) +NULL +EXPLAIN +SELECT MAX(f2) FROM t1 WHERE f2 = 'abc'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref f2 f2 4 const 1 Using where; Using index +SELECT MAX(f2) FROM t1 WHERE f2 = 'abc'; +MAX(f2) +NULL +EXPLAIN +SELECT MIN(f1) FROM t1 WHERE f1 >= 'abc'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT MIN(f1) FROM t1 WHERE f1 >= 'abc'; +MIN(f1) +b +EXPLAIN +SELECT MIN(f2) FROM t1 WHERE f2 >= 'abc'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index f2 f2 4 NULL 2 Using where; Using index +SELECT MIN(f2) FROM t1 WHERE f2 >= 'abc'; +MIN(f2) +b +EXPLAIN +SELECT MIN(f1) FROM t1 WHERE f1 BETWEEN 'abc' AND 'b' ; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT MIN(f1) FROM t1 WHERE f1 BETWEEN 'abc' AND 'b' ; +MIN(f1) +b +EXPLAIN +SELECT MIN(f2) FROM t1 WHERE f2 BETWEEN 'abc' AND 'b' ; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index f2 f2 4 NULL 2 Using where; Using index +SELECT MIN(f2) FROM t1 WHERE f2 BETWEEN 'abc' AND 'b' ; +MIN(f2) +b +DROP TABLE t1; End of 5.2 tests diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 3939d53cb31..927c4b084da 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -1194,4 +1194,37 @@ SELECT (SELECT MIN(t1.a) FROM t1,t2 WHERE t2.a = t3.b) FROM t3; DROP TABLE t1,t2,t3; --echo # +--echo # Bug #884175: MIN/MAX for short varchar = long const +--echo # + +CREATE TABLE t1 (f1 varchar(1), f2 varchar(1), KEY (f2)); +INSERT INTO t1 VALUES ('b', 'b'), ('a','a'); + +EXPLAIN +SELECT MAX(f1) FROM t1 WHERE f1 = 'abc'; +SELECT MAX(f1) FROM t1 WHERE f1 = 'abc'; + +EXPLAIN +SELECT MAX(f2) FROM t1 WHERE f2 = 'abc'; +SELECT MAX(f2) FROM t1 WHERE f2 = 'abc'; + +EXPLAIN +SELECT MIN(f1) FROM t1 WHERE f1 >= 'abc'; +SELECT MIN(f1) FROM t1 WHERE f1 >= 'abc'; + +EXPLAIN +SELECT MIN(f2) FROM t1 WHERE f2 >= 'abc'; +SELECT MIN(f2) FROM t1 WHERE f2 >= 'abc'; + +EXPLAIN +SELECT MIN(f1) FROM t1 WHERE f1 BETWEEN 'abc' AND 'b' ; +SELECT MIN(f1) FROM t1 WHERE f1 BETWEEN 'abc' AND 'b' ; + +EXPLAIN +SELECT MIN(f2) FROM t1 WHERE f2 BETWEEN 'abc' AND 'b' ; +SELECT MIN(f2) FROM t1 WHERE f2 BETWEEN 'abc' AND 'b' ; + +DROP TABLE t1; + + --echo End of 5.2 tests diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc index cd6e7a4ffaa..92a286a3b1c 100644 --- a/sql/opt_sum.cc +++ b/sql/opt_sum.cc @@ -469,8 +469,8 @@ int opt_sum_query(THD *thd, 'const op field' @retval - 0 func_item is a simple predicate: a field is compared with - constants + 0 func_item is a simple predicate: a field is compared with a constant + whose length does not exceed the max length of the field values @retval 1 Otherwise */ @@ -490,6 +490,8 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order) return 0; if (!(args[1]= item_equal->get_const())) return 0; + if (args[0]->max_length < args[1]->max_length) + return 0; } break; case 1: @@ -521,6 +523,8 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order) } else return 0; + if (args[0]->max_length < args[1]->max_length) + return 0; break; case 3: /* field BETWEEN const AND const */ @@ -534,6 +538,8 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order) if (!item->const_item()) return 0; args[i]= item; + if (args[0]->max_length < args[i]->max_length) + return 0; } } else -- cgit v1.2.1 From 160eb5b009e86c0b9ddd257dedc3aee6a3ff63eb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Mar 2012 14:06:17 +0200 Subject: Added ucs2 test moved from maria3.test. (MDEV-167) --- mysql-test/suite/maria/r/maria-ucs2.result | 33 +++++++++++++++++++++ mysql-test/suite/maria/t/maria-ucs2.test | 47 ++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 mysql-test/suite/maria/r/maria-ucs2.result create mode 100644 mysql-test/suite/maria/t/maria-ucs2.test diff --git a/mysql-test/suite/maria/r/maria-ucs2.result b/mysql-test/suite/maria/r/maria-ucs2.result new file mode 100644 index 00000000000..f7bb169d2f6 --- /dev/null +++ b/mysql-test/suite/maria/r/maria-ucs2.result @@ -0,0 +1,33 @@ +select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; +ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS +Aria YES Crash-safe tables with MyISAM heritage NO NO NO +set global storage_engine=aria; +set session storage_engine=aria; +set global aria_page_checksum=0; +set global aria_log_file_size=4294967295; +drop table if exists t1; +SET SQL_WARNINGS=1; +CREATE TABLE t1 ( a VARCHAR(800),KEY(a) ) +ENGINE=Aria DEFAULT CHARACTER SET latin1; +INSERT INTO t1 VALUES +(REPEAT('abc ',200)), (REPEAT('def ',200)), +(REPEAT('ghi ',200)), (REPEAT('jkl ',200)); +INSERT INTO t1 SELECT * FROM t1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`; +Warnings: +Warning 1071 Specified key was too long; max key length is 1000 bytes +Warning 1071 Specified key was too long; max key length is 1000 bytes +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SHOW CREATE table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(800) CHARACTER SET ucs2 DEFAULT NULL, + KEY `a` (`a`(500)) +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 +DROP TABLE t1; +# End of 5.2 tests diff --git a/mysql-test/suite/maria/t/maria-ucs2.test b/mysql-test/suite/maria/t/maria-ucs2.test new file mode 100644 index 00000000000..b635807e1ff --- /dev/null +++ b/mysql-test/suite/maria/t/maria-ucs2.test @@ -0,0 +1,47 @@ +-- source include/have_maria.inc +-- source include/have_ucs2.inc + +select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; + +let $default_engine=`select @@global.storage_engine`; +let $default_checksum=`select @@global.aria_page_checksum`; +set global storage_engine=aria; +set session storage_engine=aria; +set global aria_page_checksum=0; +let $default_log_file_size=`select @@global.aria_log_file_size`; +set global aria_log_file_size=4294967295; + +# Initialise +--disable_warnings +drop table if exists t1; +--enable_warnings +SET SQL_WARNINGS=1; + +# +# bug#905716: Assertion `page->size <= share->max_index_block_size' +# + +CREATE TABLE t1 ( a VARCHAR(800),KEY(a) ) + ENGINE=Aria DEFAULT CHARACTER SET latin1; +INSERT INTO t1 VALUES + (REPEAT('abc ',200)), (REPEAT('def ',200)), + (REPEAT('ghi ',200)), (REPEAT('jkl ',200)); +INSERT INTO t1 SELECT * FROM t1; +# check table is not needed to reproduce the problem, +# but shows that by this time the table appears to be okay. +CHECK TABLE t1; +ALTER TABLE t1 MODIFY a VARCHAR(800) CHARSET `ucs2`; +CHECK TABLE t1; +SHOW CREATE table t1; +DROP TABLE t1; + +--echo # End of 5.2 tests + + +--disable_result_log +--disable_query_log +eval set global storage_engine=$default_engine, +aria_page_checksum=$default_checksum, +aria_log_file_size=$default_log_file_size; +--enable_result_log +--enable_query_log -- cgit v1.2.1 From 9598f1c52054fa6e14df8c959445ae5d2df96984 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Fri, 9 Mar 2012 14:28:02 +0200 Subject: Added test case for lp:905782 "Assertion `pageno < ((1ULL) << 40)' failed at ma_pagecache.c:3438: pagecache_read or table corruption on INSERT into a ucs2 table" The orignal bug has been fixed earlier --- mysql-test/suite/maria/r/maria-ucs2.result | 12 +++++++++--- mysql-test/suite/maria/t/maria-ucs2.test | 18 +++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/mysql-test/suite/maria/r/maria-ucs2.result b/mysql-test/suite/maria/r/maria-ucs2.result index f7bb169d2f6..e7258f21d4f 100644 --- a/mysql-test/suite/maria/r/maria-ucs2.result +++ b/mysql-test/suite/maria/r/maria-ucs2.result @@ -3,8 +3,6 @@ ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS Aria YES Crash-safe tables with MyISAM heritage NO NO NO set global storage_engine=aria; set session storage_engine=aria; -set global aria_page_checksum=0; -set global aria_log_file_size=4294967295; drop table if exists t1; SET SQL_WARNINGS=1; CREATE TABLE t1 ( a VARCHAR(800),KEY(a) ) @@ -28,6 +26,14 @@ Table Create Table t1 CREATE TABLE `t1` ( `a` varchar(800) CHARACTER SET ucs2 DEFAULT NULL, KEY `a` (`a`(500)) -) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0 +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +DROP TABLE t1; +CREATE TABLE t1 (a VARCHAR(800),KEY(a)) ENGINE=Aria CHARACTER SET ucs2; +Warnings: +Warning 1071 Specified key was too long; max key length is 1000 bytes +INSERT INTO t1 VALUES (REPEAT('abc ',200)); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK DROP TABLE t1; # End of 5.2 tests diff --git a/mysql-test/suite/maria/t/maria-ucs2.test b/mysql-test/suite/maria/t/maria-ucs2.test index b635807e1ff..fed67d780e9 100644 --- a/mysql-test/suite/maria/t/maria-ucs2.test +++ b/mysql-test/suite/maria/t/maria-ucs2.test @@ -4,12 +4,8 @@ select * from INFORMATION_SCHEMA.ENGINES where ENGINE="ARIA"; let $default_engine=`select @@global.storage_engine`; -let $default_checksum=`select @@global.aria_page_checksum`; set global storage_engine=aria; set session storage_engine=aria; -set global aria_page_checksum=0; -let $default_log_file_size=`select @@global.aria_log_file_size`; -set global aria_log_file_size=4294967295; # Initialise --disable_warnings @@ -35,13 +31,21 @@ CHECK TABLE t1; SHOW CREATE table t1; DROP TABLE t1; +# +# BUG#905782 Assertion `pageno < ((1ULL) << 40)' failed at ma_pagecache.c +# Issue was too long key +# + +CREATE TABLE t1 (a VARCHAR(800),KEY(a)) ENGINE=Aria CHARACTER SET ucs2; +INSERT INTO t1 VALUES (REPEAT('abc ',200)); +CHECK TABLE t1; +DROP TABLE t1; + --echo # End of 5.2 tests --disable_result_log --disable_query_log -eval set global storage_engine=$default_engine, -aria_page_checksum=$default_checksum, -aria_log_file_size=$default_log_file_size; +eval set global storage_engine=$default_engine; --enable_result_log --enable_query_log -- cgit v1.2.1 From ea3ffc7f9d0794e0bebec167169801ae09215794 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 9 Mar 2012 15:37:16 -0800 Subject: Fixed LP bug #930814. This bug was introduced into mariadb 5.2 in the December 2010 with the patch that added a new engine property: the ability to support virtual columns. As a result of this bug the information from frm files for tables that contained virtual columns did not appear in the information schema tables. --- mysql-test/suite/vcol/r/vcol_misc.result | 13 +++++++++++++ mysql-test/suite/vcol/t/vcol_misc.test | 14 ++++++++++++++ sql/table.cc | 4 ++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index e83a89c44c3..d5061fa4d5f 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -133,3 +133,16 @@ t1 CREATE TABLE `t1` ( `v` char(32) CHARACTER SET ucs2 AS (a) VIRTUAL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (a int, b int as (a+1) VIRTUAL); +SELECT table_schema, table_name, column_name, column_type, extra +FROM information_schema.columns WHERE table_name = 't1'; +table_schema table_name column_name column_type extra +test t1 a int(11) +test t1 b int(11) +SELECT table_schema, table_name, column_name, column_type, extra +FROM information_schema.columns WHERE table_name = 't2'; +table_schema table_name column_name column_type extra +test t2 a int(11) +test t2 b int(11) VIRTUAL +DROP TABLE t1,t2; diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test index 2a8d9a576b4..495432fdb4c 100644 --- a/mysql-test/suite/vcol/t/vcol_misc.test +++ b/mysql-test/suite/vcol/t/vcol_misc.test @@ -140,3 +140,17 @@ CREATE TABLE t1 (a char(32), v char(32) CHARACTER SET ucs2 AS (a) VIRTUAL); SHOW CREATE TABLE t1; DROP TABLE t1; + +# +# Bug#930814: no info in information schema for tables with virtual columns +# + +CREATE TABLE t1 (a int, b int); +CREATE TABLE t2 (a int, b int as (a+1) VIRTUAL); + +SELECT table_schema, table_name, column_name, column_type, extra + FROM information_schema.columns WHERE table_name = 't1'; +SELECT table_schema, table_name, column_name, column_type, extra + FROM information_schema.columns WHERE table_name = 't2'; + +DROP TABLE t1,t2; diff --git a/sql/table.cc b/sql/table.cc index e576e5ae25f..5bcc85e3cc8 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2339,8 +2339,8 @@ partititon_err: /* Check virtual columns against table's storage engine. */ if (share->vfields && - !(outparam->file && - (outparam->file->ha_table_flags() & HA_CAN_VIRTUAL_COLUMNS))) + (outparam->file && + !(outparam->file->ha_table_flags() & HA_CAN_VIRTUAL_COLUMNS))) { my_error(ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS, MYF(0), plugin_name(share->db_plugin)->str); -- cgit v1.2.1 From 948d1d5b70a0a2e0424b21b2b1f051d843e562a9 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 12 Mar 2012 11:31:40 +0100 Subject: LP953714: Fix formatting of the crash messages in signal/exception handler --- mysys/stacktrace.c | 18 +++++++----------- sql/signal_handler.cc | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 847cc746a76..c59be6b1f48 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -685,7 +685,7 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) &(package.sym)); have_source= pSymGetLineFromAddr64(hProcess, addr, &line_offset, &line); - my_safe_printf_stderr("%p ", addr); + fprintf(stderr,"%p ", addr); if(have_module) { char *base_image_name= strrchr(module.ImageName, '\\'); @@ -693,13 +693,12 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) base_image_name++; else base_image_name= module.ImageName; - my_safe_printf_stderr("%s!", base_image_name); + fprintf(stderr,"%s!", base_image_name); } if(have_symbol) - my_safe_printf_stderr("%s()", package.sym.Name); - + fprintf(stderr, "%s()", package.sym.Name); else if(have_module) - my_safe_printf_stderr("%s", "???"); + fprintf(stderr,"%s", "???"); if(have_source) { @@ -708,10 +707,10 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) base_file_name++; else base_file_name= line.FileName; - my_safe_printf_stderr("[%s:%u]", + fprintf(stderr, "[%s:%u]", base_file_name, line.LineNumber); } - my_safe_printf_stderr("%s", "\n"); + fprintf(stderr,"%s", "\n"); } } @@ -785,10 +784,7 @@ void my_safe_print_str(const char *val, int len) #ifdef __WIN__ size_t my_write_stderr(const void *buf, size_t count) { - DWORD bytes_written; - SetFilePointer(GetStdHandle(STD_ERROR_HANDLE), 0, NULL, FILE_END); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), buf, count, &bytes_written, NULL); - return bytes_written; + return fwrite(buf, 1, count, stderr); } #else size_t my_write_stderr(const void *buf, size_t count) diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index ae0cf6e1bb0..15be12b50ec 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -72,7 +72,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) curr_time= my_time(0); localtime_r(&curr_time, &tm); - my_safe_printf_stderr("%02d%02d%02d %2d:%02d:%02d ", + fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d ", tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); if (opt_expect_abort -- cgit v1.2.1 From 3f19dfede39387c8e3a3b15721321bea2b4f61c3 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 12 Mar 2012 12:14:04 +0100 Subject: LP952607: Do not show MySQL services preinstalled by Dell in the upgrade wizard --- sql/winservice.c | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/sql/winservice.c b/sql/winservice.c index 3ec91c26835..f70f8018509 100644 --- a/sql/winservice.c +++ b/sql/winservice.c @@ -58,6 +58,41 @@ void normalize_path(char *path, size_t size) strcpy_s(path, size, buf); } +/* + Exclusion rules. + + Some hardware manufacturers deliver systems with own preinstalled MySQL copy + and services. We do not want to mess up with these installations. We will + just ignore such services, pretending it is not MySQL. + + ´@return + TRUE, if this service should be excluded from UI lists etc (OEM install) + FALSE otherwise. +*/ +BOOL exclude_service(mysqld_service_properties *props) +{ + static const char* exclude_patterns[] = + { + "common files\\dell\\mysql\\bin\\", /* Dell's private installation */ + NULL + }; + int i; + char buf[MAX_PATH]; + + /* Convert mysqld path to lower case, rules for paths are case-insensitive. */ + memcpy(buf, props->mysqld_exe, sizeof(props->mysqld_exe)); + _strlwr(buf); + + for(i= 0; exclude_patterns[i]; i++) + { + if (strstr(buf, exclude_patterns[i])) + return TRUE; + } + + return FALSE; +} + + /* Retrieve some properties from windows mysqld service binary path. We're interested in ini file location and datadir, and also in version of @@ -240,7 +275,9 @@ int get_mysql_service_properties(const wchar_t *bin_path, } } } - retval = 0; + + if (!exclude_service(props)) + retval = 0; end: LocalFree((HLOCAL)args); return retval; -- cgit v1.2.1 From 1dda8a51c6c0fa53670aa4ee7f6b4f3d169193ee Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Mar 2012 12:09:03 +0200 Subject: test suite for LP bug#694450 --- mysql-test/r/group_by.result | 18 ++++++++++++++++++ mysql-test/t/group_by.test | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 820a828d604..d322952af2b 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1941,3 +1941,21 @@ Warning 1292 Truncated incorrect INTEGER value: 'jxW<' DROP TABLE t1; SET SQL_BIG_TABLES=0; # End of 5.1 tests +# +# LP bug#694450 Wrong result with non-standard GROUP BY + ORDER BY +# +SET SESSION SQL_MODE='ONLY_FULL_GROUP_BY'; +CREATE TABLE t1 ( +f1 int(11), f2 int(11), f3 datetime, f4 varchar(1), PRIMARY KEY (f1)) ; +INSERT IGNORE INTO t1 VALUES ('1','9','2004-10-11 18:13','x'),('2','5','2004-03-07 14:02','g'),('3','1','2004-04-09 09:38','o'),('4','0','1900-01-01 00:00','g'),('5','1','2009-02-19 02:05','v'); +SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ORDER BY alias1.f2 , field2; +field1 field2 +2004-10-11 18:13:00 1 +2009-02-19 02:05:00 5 +SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ; +field1 field2 +2004-10-11 18:13:00 1 +2009-02-19 02:05:00 5 +SET SESSION SQL_MODE=default; +drop table t1; +# End of 5.2 tests diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 8f38f0e9fd9..993ee89b279 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1316,3 +1316,22 @@ DROP TABLE t1; SET SQL_BIG_TABLES=0; --echo # End of 5.1 tests + +--echo # +--echo # LP bug#694450 Wrong result with non-standard GROUP BY + ORDER BY +--echo # +SET SESSION SQL_MODE='ONLY_FULL_GROUP_BY'; +CREATE TABLE t1 ( +f1 int(11), f2 int(11), f3 datetime, f4 varchar(1), PRIMARY KEY (f1)) ; +INSERT IGNORE INTO t1 VALUES ('1','9','2004-10-11 18:13','x'),('2','5','2004-03-07 14:02','g'),('3','1','2004-04-09 09:38','o'),('4','0','1900-01-01 00:00','g'),('5','1','2009-02-19 02:05','v'); + +# This must return an error, but instead returns 1 row +SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ORDER BY alias1.f2 , field2; + +# This returns several rows +SELECT alias2.f3 AS field1 , alias2.f1 AS field2 FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f1 = alias1.f2 AND alias2.f1 != alias1.f4 GROUP BY field1 , field2 ; +SET SESSION SQL_MODE=default; +drop table t1; + +--echo # End of 5.2 tests + -- cgit v1.2.1