summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/func_group.result47
-rw-r--r--mysql-test/r/group_by.result19
-rw-r--r--mysql-test/suite/maria/r/maria-ucs2.result39
-rw-r--r--mysql-test/suite/maria/r/maria3.result31
-rw-r--r--mysql-test/suite/maria/t/maria-ucs2.test51
-rw-r--r--mysql-test/suite/maria/t/maria3.test23
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result13
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test14
-rw-r--r--mysql-test/t/func_group.test33
-rw-r--r--mysql-test/t/group_by.test20
-rw-r--r--mysys/stacktrace.c18
-rw-r--r--sql/opt_sum.cc10
-rw-r--r--sql/signal_handler.cc2
-rw-r--r--sql/table.cc4
-rw-r--r--sql/winservice.c39
-rw-r--r--win/packaging/heidisql.wxi.in9
-rw-r--r--win/packaging/heidisql_feature.wxi.in2
17 files changed, 307 insertions, 67 deletions
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index f1d3777e097..9c15af41799 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1887,6 +1887,53 @@ 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
#
# BUG#46680 - Assertion failed in file item_subselect.cc,
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 6ac3257ca6c..7405095c965 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -1952,6 +1952,24 @@ 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
+#
# BUG#872702: Crash in add_ref_to_table_cond() when grouping by a PK
#
CREATE TABLE t1 (a int, PRIMARY KEY (a)) ;
@@ -1966,3 +1984,4 @@ FROM t2
GROUP BY 1;
a
DROP TABLE t1, t2;
+# End of 5.3 tests
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..e7258f21d4f
--- /dev/null
+++ b/mysql-test/suite/maria/r/maria-ucs2.result
@@ -0,0 +1,39 @@
+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;
+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=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/r/maria3.result b/mysql-test/suite/maria/r/maria3.result
index 8c27e0e9dcd..8018ca03a8e 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/maria-ucs2.test b/mysql-test/suite/maria/t/maria-ucs2.test
new file mode 100644
index 00000000000..fed67d780e9
--- /dev/null
+++ b/mysql-test/suite/maria/t/maria-ucs2.test
@@ -0,0 +1,51 @@
+-- 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`;
+set global storage_engine=aria;
+set session storage_engine=aria;
+
+# 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;
+
+#
+# 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;
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/suite/maria/t/maria3.test b/mysql-test/suite/maria/t/maria3.test
index a2305f40807..f93706cf469 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
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 693ea0d9174..c27b36089c6 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -133,6 +133,19 @@ 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;
create table t1 (a int, b int);
insert into t1 values (3, 30), (4, 20), (1, 20);
create table t2 (c int, d int, v int as (d+1), index idx(c));
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index f87cb5fbec8..6f576f61513 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -142,6 +142,20 @@ 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;
+
+#
# SELECT that uses a virtual column and executed with BKA
#
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index f6091883168..3e31c61ac37 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1198,6 +1198,39 @@ 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
--echo #
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 5d7421904d2..2fd0668b34d 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1327,6 +1327,24 @@ 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
+
+--echo #
--echo # BUG#872702: Crash in add_ref_to_table_cond() when grouping by a PK
--echo #
CREATE TABLE t1 (a int, PRIMARY KEY (a)) ;
@@ -1343,3 +1361,5 @@ WHERE a = (
GROUP BY 1;
DROP TABLE t1, t2;
+--echo # End of 5.3 tests
+
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/opt_sum.cc b/sql/opt_sum.cc
index 5298c57954d..9e097af1e6e 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -482,8 +482,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
*/
@@ -503,6 +503,8 @@ bool simple_pred(Item_func *func_item, Item **args, bool *inv_order)
if (!(item= it++))
return 0;
args[0]= item->real_item();
+ if (args[0]->max_length < args[1]->max_length)
+ return 0;
if (it++)
return 0;
}
@@ -536,6 +538,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 */
@@ -549,6 +553,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
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index 819b87e3fdc..d58c28c2936 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
diff --git a/sql/table.cc b/sql/table.cc
index 13e643f015b..9174168bd68 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2335,8 +2335,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);
diff --git a/sql/winservice.c b/sql/winservice.c
index 3ec91c26835..f70f8018509 100644
--- a/sql/winservice.c
+++ b/sql/winservice.c
@@ -59,6 +59,41 @@ void normalize_path(char *path, size_t size)
}
/*
+ 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
the data. We tolerate missing mysqld.exe.
@@ -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;
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 @@
<RegistrySearch Id="HeidiSQL"
Root="HKLM"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\HeidiSQL_is1"
- Name="Install"
+ Name="UninstallString"
Type="raw"
Win64="no"
/>
@@ -30,11 +30,15 @@
<Component Id="component.HeidiSQL_MenuShortcut" Guid="*" Win64="no">
<RegistryValue Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\Uninstall" Name="shortcuts.heidisql" Value="1" Type="string" KeyPath="yes" />
<Shortcut Id="startmenuHeidiSQL" Directory="ShortcutFolder" Name="HeidiSQL" Target="[D.HeidiSQL]\heidisql.exe"/>
- <RemoveRegistryKey Id="HeidiSQL_RegistryCleanup" Root="HKCU" Key="SOFTWARE\HeidiSQL" Action="removeOnUninstall" />
</Component>
<Component Id="component.HeidiSQL_libmysql.dll" Guid="*" Win64="no">
<File Id="heidisql.libmysql.dll" Name="libmysql.dll" Source="${HEIDISQL_DOWNLOAD_DIR}\libmysql.dll" />
</Component>
+ <Component Id="component.HeidiSQL_CleanupSettings" Guid="*" Win64="no">
+ <Condition>HEIDISQLINSTALLED</Condition>
+ <RegistryValue Root="HKCU" Key="Software\@CPACK_WIX_PACKAGE_NAME@\UninstallCleanupHeidiSQLSettings" Name="cleanup.heidisql" Value="1" Type="string" KeyPath="yes" />
+ <RemoveRegistryKey Id="HeidiSQL_RegistryCleanup" Root="HKCU" Key="SOFTWARE\HeidiSQL" Action="removeOnUninstall" />
+ </Component>
</Directory>
</DirectoryRef>
@@ -42,5 +46,6 @@
<ComponentRef Id="component.HeidiSQL"/>
<ComponentRef Id="component.HeidiSQL_MenuShortcut"/>
<ComponentRef Id="component.HeidiSQL_libmysql.dll"/>
+ <ComponentRef Id="component.HeidiSQL_CleanupSettings"/>
</ComponentGroup>
</Include>
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'>
- <Condition Level="0">HEIDISQLINSTALLED</Condition>
+ <Condition Level="0">HEIDISQLINSTALLED AND NOT REMOVE ~= ALL</Condition>
<ComponentGroupRef Id='HeidiSQL'/>
</Feature>
</Include>