Commit 78734f14 authored by acurtis/antony@ltamd64.xiphis.org's avatar acurtis/antony@ltamd64.xiphis.org

Merge acurtis@bk-internal.mysql.com:/home/bk/mysql-5.1-engines

into  xiphis.org:/home/antony/work2/mysql-5.1-engines.merge
parents 1de28a11 849e6371
...@@ -12666,3 +12666,12 @@ t6 CREATE TABLE `t6` ( ...@@ -12666,3 +12666,12 @@ t6 CREATE TABLE `t6` (
KEY `a` (`a`) KEY `a` (`a`)
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
DROP TABLE t1, t2, t4, t5, t6; DROP TABLE t1, t2, t4, t5, t6;
create table t1 (i int) engine=archive;
insert into t1 values (1);
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair status OK
select * from t1;
i
1
drop table t1;
...@@ -259,8 +259,10 @@ create procedure p1 () ...@@ -259,8 +259,10 @@ create procedure p1 ()
begin begin
DECLARE v INT DEFAULT 0; DECLARE v INT DEFAULT 0;
DECLARE e INT DEFAULT 0; DECLARE e INT DEFAULT 0;
DECLARE i INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
WHILE v < 10000 do SET i = sleep(5);
WHILE v < 20000 do
CREATE SERVER s CREATE SERVER s
FOREIGN DATA WRAPPER mysql FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test'); OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
......
...@@ -90,3 +90,10 @@ id link name relevance ...@@ -90,3 +90,10 @@ id link name relevance
1 1 string 0 1 1 string 0
2 0 string 0 2 0 string 0
DROP TABLE t1,t2; DROP TABLE t1,t2;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT, c TEXT, KEY(b));
INSERT INTO t1 VALUES(1);
INSERT INTO t2(b,c) VALUES(2,'castle'),(3,'castle');
SELECT * FROM t1 LEFT JOIN t2 ON a=b WHERE MATCH(c) AGAINST('+castle' IN BOOLEAN MODE);
a b c
DROP TABLE t1, t2;
...@@ -1540,3 +1540,13 @@ SHOW CREATE TABLE t6; ...@@ -1540,3 +1540,13 @@ SHOW CREATE TABLE t6;
--disable_warnings --disable_warnings
DROP TABLE t1, t2, t4, t5, t6; DROP TABLE t1, t2, t4, t5, t6;
--enable_warnings --enable_warnings
#
# BUG#26138 - REPAIR TABLE with option USE_FRM erases all records in ARCHIVE
# table
#
create table t1 (i int) engine=archive;
insert into t1 values (1);
repair table t1 use_frm;
select * from t1;
drop table t1;
...@@ -296,8 +296,10 @@ create procedure p1 () ...@@ -296,8 +296,10 @@ create procedure p1 ()
begin begin
DECLARE v INT DEFAULT 0; DECLARE v INT DEFAULT 0;
DECLARE e INT DEFAULT 0; DECLARE e INT DEFAULT 0;
DECLARE i INT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET e = e + 1;
WHILE v < 10000 do SET i = sleep(5);
WHILE v < 20000 do
CREATE SERVER s CREATE SERVER s
FOREIGN DATA WRAPPER mysql FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test'); OPTIONS (USER 'Remote', HOST '192.168.1.106', DATABASE 'test');
......
...@@ -87,3 +87,14 @@ SELECT t1.*, MATCH(t1.name) AGAINST('string') AS relevance ...@@ -87,3 +87,14 @@ SELECT t1.*, MATCH(t1.name) AGAINST('string') AS relevance
DROP TABLE t1,t2; DROP TABLE t1,t2;
# End of 4.1 tests # End of 4.1 tests
#
# BUG#25729 - boolean full text search is confused by NULLs produced by LEFT
# JOIN
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT, c TEXT, KEY(b));
INSERT INTO t1 VALUES(1);
INSERT INTO t2(b,c) VALUES(2,'castle'),(3,'castle');
SELECT * FROM t1 LEFT JOIN t2 ON a=b WHERE MATCH(c) AGAINST('+castle' IN BOOLEAN MODE);
DROP TABLE t1, t2;
...@@ -1472,6 +1472,17 @@ public: ...@@ -1472,6 +1472,17 @@ public:
virtual void free_foreign_key_create_info(char* str) {} virtual void free_foreign_key_create_info(char* str) {}
/* The following can be called without an open handler */ /* The following can be called without an open handler */
virtual const char *table_type() const =0; virtual const char *table_type() const =0;
/*
If frm_error() is called then we will use this to find out what file
extentions exist for the storage engine. This is also used by the default
rename_table and delete_table method in handler.cc.
For engines that have two file name extentions (separate meta/index file
and data file), the order of elements is relevant. First element of engine
file name extentions array should be meta/index file extention. Second
element - data file extention. This order is assumed by
prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued.
*/
virtual const char **bas_ext() const =0; virtual const char **bas_ext() const =0;
virtual int get_default_no_partitions(HA_CREATE_INFO *info) { return 1;} virtual int get_default_no_partitions(HA_CREATE_INFO *info) { return 1;}
......
...@@ -4608,14 +4608,14 @@ void Item_func_match::init_search(bool no_order) ...@@ -4608,14 +4608,14 @@ void Item_func_match::init_search(bool no_order)
fields.push_back(new Item_string(" ",1, cmp_collation.collation)); fields.push_back(new Item_string(" ",1, cmp_collation.collation));
for (uint i=1; i < arg_count; i++) for (uint i=1; i < arg_count; i++)
fields.push_back(args[i]); fields.push_back(args[i]);
concat=new Item_func_concat_ws(fields); concat_ws=new Item_func_concat_ws(fields);
/* /*
Above function used only to get value and do not need fix_fields for it: Above function used only to get value and do not need fix_fields for it:
Item_string - basic constant Item_string - basic constant
fields - fix_fields() was already called for this arguments fields - fix_fields() was already called for this arguments
Item_func_concat_ws - do not need fix_fields() to produce value Item_func_concat_ws - do not need fix_fields() to produce value
*/ */
concat->quick_fix_field(); concat_ws->quick_fix_field();
} }
if (master) if (master)
...@@ -4830,8 +4830,8 @@ double Item_func_match::val_real() ...@@ -4830,8 +4830,8 @@ double Item_func_match::val_real()
if (key == NO_SUCH_KEY) if (key == NO_SUCH_KEY)
{ {
String *a= concat->val_str(&value); String *a= concat_ws->val_str(&value);
if ((null_value= (a == 0))) if ((null_value= (a == 0)) || !a->length())
DBUG_RETURN(0); DBUG_RETURN(0);
DBUG_RETURN(ft_handler->please->find_relevance(ft_handler, DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
(byte *)a->ptr(), a->length())); (byte *)a->ptr(), a->length()));
......
...@@ -1337,12 +1337,12 @@ public: ...@@ -1337,12 +1337,12 @@ public:
FT_INFO *ft_handler; FT_INFO *ft_handler;
TABLE *table; TABLE *table;
Item_func_match *master; // for master-slave optimization Item_func_match *master; // for master-slave optimization
Item *concat; // Item_func_concat_ws Item *concat_ws; // Item_func_concat_ws
String value; // value of concat String value; // value of concat_ws
String search_value; // key_item()'s value converted to cmp_collation String search_value; // key_item()'s value converted to cmp_collation
Item_func_match(List<Item> &a, uint b): Item_real_func(a), key(0), flags(b), Item_func_match(List<Item> &a, uint b): Item_real_func(a), key(0), flags(b),
join_key(0), ft_handler(0), table(0), master(0), concat(0) { } join_key(0), ft_handler(0), table(0), master(0), concat_ws(0) { }
void cleanup() void cleanup()
{ {
DBUG_ENTER("Item_func_match"); DBUG_ENTER("Item_func_match");
...@@ -1350,7 +1350,7 @@ public: ...@@ -1350,7 +1350,7 @@ public:
if (!master && ft_handler) if (!master && ft_handler)
ft_handler->please->close_search(ft_handler); ft_handler->please->close_search(ft_handler);
ft_handler= 0; ft_handler= 0;
concat= 0; concat_ws= 0;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
enum Functype functype() const { return FT_FUNC; } enum Functype functype() const { return FT_FUNC; }
......
...@@ -3938,7 +3938,9 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, ...@@ -3938,7 +3938,9 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
/* /*
Check if this is a table type that stores index and data separately, Check if this is a table type that stores index and data separately,
like ISAM or MyISAM like ISAM or MyISAM. We assume fixed order of engine file name
extentions array. First element of engine file name extentions array
is meta/index file extention. Second element - data file extention.
*/ */
ext= table->file->bas_ext(); ext= table->file->bas_ext();
if (!ext[0] || !ext[1]) if (!ext[0] || !ext[1])
......
...@@ -247,6 +247,12 @@ ha_example::ha_example(handlerton *hton, TABLE_SHARE *table_arg) ...@@ -247,6 +247,12 @@ ha_example::ha_example(handlerton *hton, TABLE_SHARE *table_arg)
used by the default rename_table and delete_table method in used by the default rename_table and delete_table method in
handler.cc. handler.cc.
For engines that have two file name extentions (separate meta/index file
and data file), the order of elements is relevant. First element of engine
file name extentions array should be meta/index file extention. Second
element - data file extention. This order is assumed by
prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued.
@see @see
rename_table method in handler.cc and rename_table method in handler.cc and
delete_table method in handler.cc delete_table method in handler.cc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment