summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/feedback_plugin_install.result2
-rw-r--r--mysql-test/r/feedback_plugin_load.result2
-rw-r--r--mysql-test/r/feedback_plugin_send.result2
-rw-r--r--mysql-test/r/subselect3.result47
-rw-r--r--mysql-test/r/subselect3_jcl6.result47
-rw-r--r--mysql-test/r/table_elim.result19
-rw-r--r--mysql-test/t/feedback_plugin_send.test1
-rw-r--r--mysql-test/t/subselect3.test47
-rw-r--r--mysql-test/t/table_elim.test18
-rw-r--r--plugin/feedback/feedback.cc6
-rw-r--r--plugin/feedback/url_http.cc10
-rw-r--r--plugin/feedback/utils.cc17
-rw-r--r--sql-common/my_time.c2
-rw-r--r--sql/item.h15
-rw-r--r--sql/item_cmpfunc.cc9
-rw-r--r--sql/item_subselect.cc2
-rw-r--r--sql/item_subselect.h1
-rw-r--r--sql/opt_table_elimination.cc2
-rw-r--r--sql/records.cc2
-rw-r--r--storage/maria/ma_blockrec.c8
-rw-r--r--storage/maria/ma_ft_update.c8
-rw-r--r--storage/maria/ma_loghandler.c4
-rw-r--r--storage/maria/ma_open.c5
-rw-r--r--storage/myisam/mi_check.c15
-rw-r--r--storage/pbxt/src/ha_pbxt.cc2
-rw-r--r--storage/pbxt/src/thread_xt.cc3
-rw-r--r--storage/xtradb/buf/buf0buf.c4
-rw-r--r--storage/xtradb/handler/ha_innodb.cc2
28 files changed, 256 insertions, 46 deletions
diff --git a/mysql-test/r/feedback_plugin_install.result b/mysql-test/r/feedback_plugin_install.result
index 4b3b0226fae..b1b35072a08 100644
--- a/mysql-test/r/feedback_plugin_install.result
+++ b/mysql-test/r/feedback_plugin_install.result
@@ -5,7 +5,7 @@ ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
-FEEDBACK 1.0
+FEEDBACK 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
diff --git a/mysql-test/r/feedback_plugin_load.result b/mysql-test/r/feedback_plugin_load.result
index bc02b920a11..d434d1282c5 100644
--- a/mysql-test/r/feedback_plugin_load.result
+++ b/mysql-test/r/feedback_plugin_load.result
@@ -4,7 +4,7 @@ ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
-FEEDBACK 1.0
+FEEDBACK 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
diff --git a/mysql-test/r/feedback_plugin_send.result b/mysql-test/r/feedback_plugin_send.result
index 22379e26248..db622cb3f97 100644
--- a/mysql-test/r/feedback_plugin_send.result
+++ b/mysql-test/r/feedback_plugin_send.result
@@ -4,7 +4,7 @@ ACTIVE
select * from information_schema.feedback where variable_name like 'feed%'
and variable_name not like '%_uid';
VARIABLE_NAME VARIABLE_VALUE
-FEEDBACK 1.0
+FEEDBACK 1.1
FEEDBACK_SEND_RETRY_WAIT 60
FEEDBACK_SEND_TIMEOUT 60
FEEDBACK_URL http://mariadb.org/feedback_plugin/post
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index 9ce3c8dfbe3..be922e7cbd4 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -1424,4 +1424,51 @@ CALL p1;
ERROR 42S22: Unknown column 'f1' in 'where clause'
DROP PROCEDURE p1;
DROP TABLE t1, t2;
+#
+# fix of LP BUG#824425 (prohibiting subqueries in row in
+# left part of IN/ALL/ANY)
+#
+CREATE TABLE t1 ( a int) ;
+INSERT INTO t1 VALUES (20),(30);
+CREATE TABLE t2 (a int) ;
+INSERT INTO t2 VALUES (3),(9);
+CREATE TABLE t3 ( a int, b int) ;
+INSERT INTO t3 VALUES (20,5),(30,6);
+set @optimizer_switch_save=@@optimizer_switch;
+SET SESSION optimizer_switch='semijoin=OFF,in_to_exists=OFF,materialization=ON,partial_match_rowid_merge=ON,partial_match_table_scan=OFF';
+SELECT * FROM t1
+WHERE (
+( SELECT a FROM t2 WHERE a = 9 )
+) NOT IN (
+SELECT b
+FROM t3
+);
+a
+20
+30
+explain extended
+SELECT * FROM t1
+WHERE (
+( SELECT a FROM t2 WHERE a = 9 )
+) NOT IN (
+SELECT b
+FROM t3
+);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
+3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (not(<expr_cache><(select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t2`.`a` = 9))>(<in_optimizer>((select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t2`.`a` = 9)),(select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t2`.`a` = 9)) in ( <materialize> (select `test`.`t3`.`b` from `test`.`t3` ), <primary_index_lookup>(9 in <temporary table> on distinct_key where ((9 = `<subquery3>`.`b`))))))))
+SELECT * FROM t1
+WHERE (
+( SELECT a FROM t2 WHERE a = 9 ),
+( SELECT a FROM t2 WHERE a = 3 )
+) NOT IN (
+SELECT b , a
+FROM t3
+);
+ERROR 42000: This version of MySQL doesn't yet support 'SUBQUERY in ROW in left expression of IN/ALL/ANY'
+set optimizer_switch=@optimizer_switch_save;
+drop table t1,t2,t3;
set @@optimizer_switch=@subselect3_tmp;
diff --git a/mysql-test/r/subselect3_jcl6.result b/mysql-test/r/subselect3_jcl6.result
index eacf84428cb..6e2280c1d42 100644
--- a/mysql-test/r/subselect3_jcl6.result
+++ b/mysql-test/r/subselect3_jcl6.result
@@ -1433,6 +1433,53 @@ CALL p1;
ERROR 42S22: Unknown column 'f1' in 'where clause'
DROP PROCEDURE p1;
DROP TABLE t1, t2;
+#
+# fix of LP BUG#824425 (prohibiting subqueries in row in
+# left part of IN/ALL/ANY)
+#
+CREATE TABLE t1 ( a int) ;
+INSERT INTO t1 VALUES (20),(30);
+CREATE TABLE t2 (a int) ;
+INSERT INTO t2 VALUES (3),(9);
+CREATE TABLE t3 ( a int, b int) ;
+INSERT INTO t3 VALUES (20,5),(30,6);
+set @optimizer_switch_save=@@optimizer_switch;
+SET SESSION optimizer_switch='semijoin=OFF,in_to_exists=OFF,materialization=ON,partial_match_rowid_merge=ON,partial_match_table_scan=OFF';
+SELECT * FROM t1
+WHERE (
+( SELECT a FROM t2 WHERE a = 9 )
+) NOT IN (
+SELECT b
+FROM t3
+);
+a
+20
+30
+explain extended
+SELECT * FROM t1
+WHERE (
+( SELECT a FROM t2 WHERE a = 9 )
+) NOT IN (
+SELECT b
+FROM t3
+);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
+3 SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (not(<expr_cache><(select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t2`.`a` = 9))>(<in_optimizer>((select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t2`.`a` = 9)),(select `test`.`t2`.`a` from `test`.`t2` where (`test`.`t2`.`a` = 9)) in ( <materialize> (select `test`.`t3`.`b` from `test`.`t3` ), <primary_index_lookup>(9 in <temporary table> on distinct_key where ((9 = `<subquery3>`.`b`))))))))
+SELECT * FROM t1
+WHERE (
+( SELECT a FROM t2 WHERE a = 9 ),
+( SELECT a FROM t2 WHERE a = 3 )
+) NOT IN (
+SELECT b , a
+FROM t3
+);
+ERROR 42000: This version of MySQL doesn't yet support 'SUBQUERY in ROW in left expression of IN/ALL/ANY'
+set optimizer_switch=@optimizer_switch_save;
+drop table t1,t2,t3;
set @@optimizer_switch=@subselect3_tmp;
set join_cache_level=default;
show variables like 'join_cache_level';
diff --git a/mysql-test/r/table_elim.result b/mysql-test/r/table_elim.result
index b4d3a2f6f2f..892ac29d6d5 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -567,3 +567,22 @@ id select_type table type possible_keys key key_len ref rows Extra
# ^^ The above must not produce a QEP of t3,t5,t2,t4
# as that violates the "no interleaving of outer join nests" rule.
DROP TABLE t1,t2,t3,t4,t5;
+#
+# BUG#884184: Wrong result with RIGHT JOIN + derived_merge
+#
+CREATE TABLE t1 (a int(11), b varchar(1)) ;
+INSERT IGNORE INTO t1 VALUES (0,'g');
+CREATE TABLE t3 ( a varchar(1)) ;
+INSERT IGNORE INTO t3 VALUES ('g');
+CREATE TABLE t2 ( a int(11) NOT NULL, PRIMARY KEY (a)) ;
+create view v1 as SELECT t1.* FROM t1 LEFT JOIN t2 ON ( t1.a = t2.a ) WHERE t2.a <> 0;
+SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b );
+a b
+NULL NULL
+EXPLAIN SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b );
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 system NULL NULL NULL NULL 1
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where; Using index
+drop view v1;
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/t/feedback_plugin_send.test b/mysql-test/t/feedback_plugin_send.test
index b49c0d0e252..14765ee9543 100644
--- a/mysql-test/t/feedback_plugin_send.test
+++ b/mysql-test/t/feedback_plugin_send.test
@@ -1,5 +1,4 @@
source t/feedback_plugin_load.test;
-source include/big_test.inc;
if (!$MTR_FEEDBACK_PLUGIN) {
skip MTR_FEEDBACK_PLUGIN is not set;
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index e0f62a29465..4691ef37f40 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -1187,5 +1187,52 @@ CALL p1;
DROP PROCEDURE p1;
DROP TABLE t1, t2;
+
+--echo #
+--echo # fix of LP BUG#824425 (prohibiting subqueries in row in
+--echo # left part of IN/ALL/ANY)
+--echo #
+
+CREATE TABLE t1 ( a int) ;
+INSERT INTO t1 VALUES (20),(30);
+
+CREATE TABLE t2 (a int) ;
+INSERT INTO t2 VALUES (3),(9);
+
+CREATE TABLE t3 ( a int, b int) ;
+INSERT INTO t3 VALUES (20,5),(30,6);
+
+set @optimizer_switch_save=@@optimizer_switch;
+SET SESSION optimizer_switch='semijoin=OFF,in_to_exists=OFF,materialization=ON,partial_match_rowid_merge=ON,partial_match_table_scan=OFF';
+
+SELECT * FROM t1
+WHERE (
+ ( SELECT a FROM t2 WHERE a = 9 )
+) NOT IN (
+ SELECT b
+ FROM t3
+);
+explain extended
+SELECT * FROM t1
+WHERE (
+ ( SELECT a FROM t2 WHERE a = 9 )
+) NOT IN (
+ SELECT b
+ FROM t3
+);
+
+--error ER_NOT_SUPPORTED_YET
+SELECT * FROM t1
+WHERE (
+ ( SELECT a FROM t2 WHERE a = 9 ),
+ ( SELECT a FROM t2 WHERE a = 3 )
+) NOT IN (
+ SELECT b , a
+ FROM t3
+);
+set optimizer_switch=@optimizer_switch_save;
+
+drop table t1,t2,t3;
+
# The following command must be the last one the file
set @@optimizer_switch=@subselect3_tmp;
diff --git a/mysql-test/t/table_elim.test b/mysql-test/t/table_elim.test
index 3d17c7f5513..3b584ce2b38 100644
--- a/mysql-test/t/table_elim.test
+++ b/mysql-test/t/table_elim.test
@@ -500,3 +500,21 @@ WHERE t3.f2 ;
DROP TABLE t1,t2,t3,t4,t5;
+--echo #
+--echo # BUG#884184: Wrong result with RIGHT JOIN + derived_merge
+--echo #
+CREATE TABLE t1 (a int(11), b varchar(1)) ;
+INSERT IGNORE INTO t1 VALUES (0,'g');
+
+CREATE TABLE t3 ( a varchar(1)) ;
+INSERT IGNORE INTO t3 VALUES ('g');
+
+CREATE TABLE t2 ( a int(11) NOT NULL, PRIMARY KEY (a)) ;
+create view v1 as SELECT t1.* FROM t1 LEFT JOIN t2 ON ( t1.a = t2.a ) WHERE t2.a <> 0;
+
+SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b );
+EXPLAIN SELECT alias1.* FROM t3 LEFT JOIN v1 as alias1 ON ( t3.a = alias1.b );
+
+drop view v1;
+DROP TABLE t1,t2,t3;
+
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index e0d76706a0e..d8a291366ed 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -346,7 +346,7 @@ mysql_declare_plugin(feedback)
PLUGIN_LICENSE_GPL,
feedback::init,
feedback::free,
- 0x0100,
+ 0x0101,
NULL,
feedback::settings,
NULL
@@ -363,10 +363,10 @@ maria_declare_plugin(feedback)
PLUGIN_LICENSE_GPL,
feedback::init,
feedback::free,
- 0x0100,
+ 0x0101,
NULL,
feedback::settings,
- "1.0",
+ "1.1",
MariaDB_PLUGIN_MATURITY_BETA
}
maria_declare_plugin_end;
diff --git a/plugin/feedback/url_http.cc b/plugin/feedback/url_http.cc
index e1f60d60de7..71b67a52807 100644
--- a/plugin/feedback/url_http.cc
+++ b/plugin/feedback/url_http.cc
@@ -155,7 +155,7 @@ int Url_http::send(const char* data, size_t data_length)
{
my_socket fd= INVALID_SOCKET;
char buf[1024];
- uint len;
+ uint len= 0;
addrinfo *addrs, *addr, filter= {0, AF_UNSPEC, SOCK_STREAM, 6, 0, 0, 0, 0};
int res= getaddrinfo(host.str, port.str, &filter, &addrs);
@@ -258,7 +258,13 @@ int Url_http::send(const char* data, size_t data_length)
Extract the first string between <h1>...</h1> tags
and put it as a server reply into the error log.
*/
- len= vio_read(vio, (uchar*)buf, sizeof(buf)-1);
+ for (;;)
+ {
+ size_t i= vio_read(vio, (uchar*)buf + len, sizeof(buf) - len - 1);
+ if ((int)i <= 0)
+ break;
+ len+= i;
+ }
if (len && len < sizeof(buf))
{
char *from;
diff --git a/plugin/feedback/utils.cc b/plugin/feedback/utils.cc
index f32b527c052..48bbd72d530 100644
--- a/plugin/feedback/utils.cc
+++ b/plugin/feedback/utils.cc
@@ -188,24 +188,24 @@ int fill_plugin_version(THD *thd, TABLE_LIST *tables)
*/
static ulonglong my_getphysmem()
{
+#ifdef _WIN32
+ MEMORYSTATUSEX memstatus;
+ memstatus.dwLength= sizeof(memstatus);
+ GlobalMemoryStatusEx(&memstatus);
+ return memstatus.ullTotalPhys;
+#else
ulonglong pages= 0;
+
#ifdef _SC_PHYS_PAGES
pages= sysconf(_SC_PHYS_PAGES);
-#else
- return 0;
#endif
#ifdef _SC_PAGESIZE
return pages * sysconf(_SC_PAGESIZE);
-#endif
-#ifdef _WIN32
- MEMORYSTATUSEX memstatus;
- memstatus.dwLength= sizeof(memstatus);
- GlobalMemoryStatusEx(&memstatus);
- return memstatus.ullTotalPhys;
#else
return pages * my_getpagesize();
#endif
+#endif
}
/* get the number of (online) CPUs */
@@ -356,6 +356,7 @@ int fill_misc_data(THD *thd, TABLE_LIST *tables)
INSERT1("Cpu_count", (my_getncpus(), UNSIGNED));
#endif
INSERT1("Mem_total", (my_getphysmem(), UNSIGNED));
+ INSERT1("Now", (thd->query_start(), UNSIGNED));
return 0;
}
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 1d7960101a7..d2f7a8641ba 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -345,7 +345,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
{
if (str[0] == 'p' || str[0] == 'P')
add_hours= 12;
- else if (str[0] != 'a' || str[0] != 'A')
+ else if (str[0] != 'a' && str[0] != 'A')
continue; /* Not AM/PM */
str+= 2; /* Skip AM/PM */
/* Skip space after AM/PM */
diff --git a/sql/item.h b/sql/item.h
index fa6918d8484..e05fbf3b67d 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -1023,6 +1023,7 @@ public:
virtual bool view_used_tables_processor(uchar *arg) { return 0; }
virtual bool eval_not_null_tables(uchar *opt_arg) { return 0; }
virtual bool clear_sum_processor(uchar *opt_arg) { return 0; }
+ virtual bool is_subquery_processor (uchar *opt_arg) { return 0; }
/* To call bool function for all arguments */
struct bool_func_call_args
@@ -3636,6 +3637,20 @@ public:
virtual void store(Item *item);
virtual bool cache_value()= 0;
bool is_null() { return null_value; }
+ virtual bool is_expensive()
+ {
+ DBUG_ASSERT(example);
+ if (value_cached)
+ return false;
+ return example->is_expensive();
+ }
+ bool is_expensive_processor(uchar *arg)
+ {
+ DBUG_ASSERT(example);
+ if (value_cached)
+ return false;
+ return example->is_expensive_processor(arg);
+ }
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index a33dd090f14..5b2c862e9eb 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1436,6 +1436,7 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
cache->setup(args[0]);
if (cache->cols() == 1)
{
+ DBUG_ASSERT(args[0]->type() != ROW_ITEM);
if ((used_tables_cache= args[0]->used_tables()))
cache->set_used_tables(OUTER_REF_TABLE_BIT);
else
@@ -1446,6 +1447,14 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
uint n= cache->cols();
for (uint i= 0; i < n; i++)
{
+ /* Check that the expression (part of row) do not contain a subquery */
+ if (args[0]->element_index(i)->walk(&Item::is_subquery_processor,
+ FALSE, NULL))
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0),
+ "SUBQUERY in ROW in left expression of IN/ALL/ANY");
+ return 1;
+ }
if (args[0]->element_index(i)->used_tables())
((Item_cache *)cache->element_index(i))->set_used_tables(OUTER_REF_TABLE_BIT);
else
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 6134903fee6..71408528903 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -528,7 +528,7 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery,
invalidated by irreversible cleanups (those happen after an uncorrelated
subquery has been executed).
*/
- return FALSE;
+ return (this->*processor)(argument);
}
if (walk_subquery)
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 0ec0969e0ae..2012306c0f7 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -226,6 +226,7 @@ public:
const char *func_name() const { DBUG_ASSERT(0); return "subselect"; }
virtual bool expr_cache_is_needed(THD *);
virtual void get_cache_parameters(List<Item> &parameters);
+ virtual bool is_subquery_processor (uchar *opt_arg) { return 1; }
friend class select_result_interceptor;
friend class Item_in_optimizer;
diff --git a/sql/opt_table_elimination.cc b/sql/opt_table_elimination.cc
index 56396181619..545001c9df1 100644
--- a/sql/opt_table_elimination.cc
+++ b/sql/opt_table_elimination.cc
@@ -693,6 +693,8 @@ eliminate_tables_for_list(JOIN *join, List<TABLE_LIST> *join_list,
{
table_map outside_used_tables= tables_used_elsewhere |
tables_used_on_left;
+ if (on_expr)
+ outside_used_tables |= on_expr->used_tables();
if (tbl->nested_join)
{
/* This is "... LEFT JOIN (join_nest) ON cond" */
diff --git a/sql/records.cc b/sql/records.cc
index b125c201621..400287ec57c 100644
--- a/sql/records.cc
+++ b/sql/records.cc
@@ -626,7 +626,7 @@ static int rr_cmp(uchar *a,uchar *b)
if (a[4] != b[4])
return (int) a[4] - (int) b[4];
if (a[5] != b[5])
- return (int) a[1] - (int) b[5];
+ return (int) a[5] - (int) b[5];
if (a[6] != b[6])
return (int) a[6] - (int) b[6];
return (int) a[7] - (int) b[7];
diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c
index 670be915570..74898d981e9 100644
--- a/storage/maria/ma_blockrec.c
+++ b/storage/maria/ma_blockrec.c
@@ -5015,6 +5015,7 @@ static my_bool read_row_extent_info(MARIA_HA *info, uchar *buff,
MARIA_RECORD_POS *tail_pos;
uchar *data, *end_of_data;
uint flag, row_extents, row_extents_size;
+ uint field_lengths __attribute__ ((unused));
uchar *extents, *end;
DBUG_ENTER("read_row_extent_info");
@@ -5049,6 +5050,13 @@ static my_bool read_row_extent_info(MARIA_HA *info, uchar *buff,
}
info->cur_row.extents_count= row_extents;
+ /*
+ field_lengths looks unused but get_key_length will
+ increment data, which is required as data it's used later.
+ */
+ if (share->base.max_field_lengths)
+ get_key_length(field_lengths, data);
+
if (share->calc_checksum)
info->cur_row.checksum= (uint) (uchar) *data++;
if (row_extents > 1)
diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c
index 8576746981e..e99366033b4 100644
--- a/storage/maria/ma_ft_update.c
+++ b/storage/maria/ma_ft_update.c
@@ -319,6 +319,7 @@ my_bool _ma_ft_convert_to_ft2(MARIA_HA *info, MARIA_KEY *key)
uchar *key_ptr= (uchar*) dynamic_array_ptr(da, 0), *end;
uint length, key_length;
MARIA_PINNED_PAGE tmp_page_link, *page_link= &tmp_page_link;
+ MARIA_KEY tmp_key;
MARIA_PAGE page;
DBUG_ENTER("_ma_ft_convert_to_ft2");
@@ -356,9 +357,14 @@ my_bool _ma_ft_convert_to_ft2(MARIA_HA *info, MARIA_KEY *key)
/* inserting the rest of key values */
end= (uchar*) dynamic_array_ptr(da, da->elements);
+ tmp_key.keyinfo= keyinfo;
+ tmp_key.data_length= keyinfo->keylength;
+ tmp_key.ref_length= 0;
+ tmp_key.flag= 0;
for (key_ptr+=length; key_ptr < end; key_ptr+=keyinfo->keylength)
{
- if (_ma_ck_real_write_btree(info, key, &root, SEARCH_SAME))
+ tmp_key.data= key_ptr;
+ if (_ma_ck_real_write_btree(info, &tmp_key, &root, SEARCH_SAME))
DBUG_RETURN(1);
}
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index d54b0ed430f..874f4b56e37 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -2611,11 +2611,11 @@ static my_bool translog_buffer_flush(struct st_translog_buffer *buffer)
i < buffer->size;
i+= TRANSLOG_PAGE_SIZE, pg++)
{
+ TRANSLOG_ADDRESS addr __attribute__((unused))= (buffer->offset + i);
DBUG_PRINT("info", ("send log form %lu till %lu address: (%lu,0x%lx) "
"page #: %lu buffer size: %lu buffer: 0x%lx",
(ulong) i, (ulong) (i + TRANSLOG_PAGE_SIZE),
- LSN_IN_PARTS(buffer->offset + i), (ulong) pg,
- (ulong) buffer->size,
+ LSN_IN_PARTS(addr), (ulong) pg, (ulong) buffer->size,
(ulong) buffer));
DBUG_ASSERT(log_descriptor.pagecache->block_size == TRANSLOG_PAGE_SIZE);
DBUG_ASSERT(i + TRANSLOG_PAGE_SIZE <= buffer->size);
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index a7287e75127..5c507ba1bfa 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -1842,6 +1842,7 @@ void _ma_set_index_pagecache_callbacks(PAGECACHE_FILE *file,
int _ma_open_datafile(MARIA_HA *info, MARIA_SHARE *share, const char *org_name,
File file_to_dup __attribute__((unused)))
{
+ char *data_name= share->data_file_name.str;
char real_data_name[FN_REFLEN];
if (org_name)
@@ -1855,12 +1856,12 @@ int _ma_open_datafile(MARIA_HA *info, MARIA_SHARE *share, const char *org_name,
my_errno= HA_WRONG_CREATE_OPTION;
return 1;
}
+ data_name= real_data_name;
}
}
info->dfile.file= share->bitmap.file.file=
- my_open(share->data_file_name.str, share->mode | O_SHARE,
- MYF(MY_WME));
+ my_open(data_name, share->mode | O_SHARE, MYF(MY_WME));
return info->dfile.file >= 0 ? 0 : 1;
}
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index eb4592f4459..3dae65eed0b 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -941,7 +941,7 @@ static uint isam_key_length(MI_INFO *info, register MI_KEYDEF *keyinfo)
int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend)
{
int error,got_error,flag;
- uint key,UNINIT_VAR(left_length),b_type,field;
+ uint key, UNINIT_VAR(left_length), b_type;
ha_rows records,del_blocks;
my_off_t used,empty,pos,splits,UNINIT_VAR(start_recpos),
del_length,link_used,start_block;
@@ -972,19 +972,6 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend)
got_error=error=0;
empty=info->s->pack.header_length;
- /* Check how to calculate checksum of rows */
- if (info->s->data_file_type == COMPRESSED_RECORD)
- {
- for (field=0 ; field < info->s->base.fields ; field++)
- {
- if (info->s->rec[field].base_type == FIELD_BLOB ||
- info->s->rec[field].base_type == FIELD_VARCHAR)
- {
- break;
- }
- }
- }
-
pos=my_b_tell(&param->read_cache);
bzero((char*) key_checksum, info->s->base.keys * sizeof(key_checksum[0]));
while (pos < info->state->data_file_length)
diff --git a/storage/pbxt/src/ha_pbxt.cc b/storage/pbxt/src/ha_pbxt.cc
index bca4f017e7d..e551843a7b8 100644
--- a/storage/pbxt/src/ha_pbxt.cc
+++ b/storage/pbxt/src/ha_pbxt.cc
@@ -2898,11 +2898,9 @@ int ha_pbxt::update_row(const byte * old_data, byte * new_data)
* insert into t1 (val) values (1);
*/
if (table->found_next_number_field && new_data == table->record[0]) {
- MX_LONGLONG_T nr __attribute__ ((unused));
my_bitmap_map *old_map;
old_map = mx_tmp_use_all_columns(table, table->read_set);
- nr = table->found_next_number_field->val_int();
ha_set_auto_increment(pb_open_tab, table->found_next_number_field);
mx_tmp_restore_column_map(table, old_map);
}
diff --git a/storage/pbxt/src/thread_xt.cc b/storage/pbxt/src/thread_xt.cc
index 07f642e34b6..2ba287c1848 100644
--- a/storage/pbxt/src/thread_xt.cc
+++ b/storage/pbxt/src/thread_xt.cc
@@ -489,8 +489,7 @@ static void thr_free_resources(XTThreadPtr self, XTResourcePtr top)
xtPublic void xt_bug(XTThreadPtr XT_UNUSED(self))
{
static int *bug_ptr __attribute__ ((unused));
- bug_ptr= NULL;
-
+
bug_ptr = NULL;
}
diff --git a/storage/xtradb/buf/buf0buf.c b/storage/xtradb/buf/buf0buf.c
index 8f9c40878f7..40a907b4199 100644
--- a/storage/xtradb/buf/buf0buf.c
+++ b/storage/xtradb/buf/buf0buf.c
@@ -3895,7 +3895,6 @@ buf_page_io_complete(
enum buf_io_fix io_type;
const ibool uncompressed = (buf_page_get_state(bpage)
== BUF_BLOCK_FILE_PAGE);
- //enum buf_flush flush_type;
mutex_t* block_mutex;
ut_a(buf_page_in_file(bpage));
@@ -4049,7 +4048,8 @@ corrupt:
}
}
- //buf_pool_mutex_enter();
+ //enum buf_flush flush_type;
+ //buf_pool_mutex_enter();
if (io_type == BUF_IO_WRITE) {
//flush_type = buf_page_get_flush_type(bpage);
/* to keep consistency at buf_LRU_insert_zip_clean() */
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 4eee85db06b..783508658a3 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -7289,7 +7289,7 @@ ha_innobase::create(
if (srv_file_per_table
&& !mysqld_embedded
- && (!create_info->options & HA_LEX_CREATE_TMP_TABLE)) {
+ && !(create_info->options & HA_LEX_CREATE_TMP_TABLE)) {
if ((name[1] == ':')
|| (name[0] == '\\' && name[1] == '\\')) {