Commit 3c1e8aa4 authored by serg@serg.mylan's avatar serg@serg.mylan

Merge bk-internal:/home/bk/mysql-4.1/

into serg.mylan:/usr/home/serg/Abk/mysql-4.1
parents 80b01886 15249d6a
...@@ -61,12 +61,12 @@ typedef struct st_ftb_expr FTB_EXPR; ...@@ -61,12 +61,12 @@ typedef struct st_ftb_expr FTB_EXPR;
struct st_ftb_expr struct st_ftb_expr
{ {
FTB_EXPR *up; FTB_EXPR *up;
my_off_t docid[2]; uint flags;
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */ /* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
my_off_t docid[2];
float weight; float weight;
float cur_weight; float cur_weight;
byte *quot, *qend; byte *quot, *qend;
uint flags;
uint yesses; /* number of "yes" words matched */ uint yesses; /* number of "yes" words matched */
uint nos; /* number of "no" words matched */ uint nos; /* number of "no" words matched */
uint ythresh; /* number of "yes" words in expr */ uint ythresh; /* number of "yes" words in expr */
...@@ -76,13 +76,13 @@ struct st_ftb_expr ...@@ -76,13 +76,13 @@ struct st_ftb_expr
typedef struct st_ftb_word typedef struct st_ftb_word
{ {
FTB_EXPR *up; FTB_EXPR *up;
MI_KEYDEF *keyinfo; uint flags;
my_off_t docid[2]; /* for index search and for scan */
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */ /* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
my_off_t docid[2]; /* for index search and for scan */
my_off_t key_root; my_off_t key_root;
MI_KEYDEF *keyinfo;
float weight; float weight;
uint ndepth; uint ndepth;
uint flags;
uint len; uint len;
uchar off; uchar off;
byte word[1]; byte word[1];
......
...@@ -93,20 +93,22 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end, ...@@ -93,20 +93,22 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
for (;doc<end;doc++) for (;doc<end;doc++)
{ {
if (true_word_char(cs,*doc)) break; if (true_word_char(cs,*doc)) break;
if (*doc == FTB_RQUOT && param->quot) { if (*doc == FTB_RQUOT && param->quot)
{
param->quot=doc; param->quot=doc;
*start=doc+1; *start=doc+1;
return 3; /* FTB_RBR */ return 3; /* FTB_RBR */
} }
if ((*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT) if (!param->quot)
&& !param->quot) {
if (*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT)
{ {
/* param->prev=' '; */ /* param->prev=' '; */
*start=doc+1; *start=doc+1;
if (*doc == FTB_LQUOT) param->quot=*start; if (*doc == FTB_LQUOT) param->quot=*start;
return (*doc == FTB_RBR)+2; return (*doc == FTB_RBR)+2;
} }
if (param->prev == ' ' && !param->quot) if (param->prev == ' ')
{ {
if (*doc == FTB_YES ) { param->yesno=+1; continue; } else if (*doc == FTB_YES ) { param->yesno=+1; continue; } else
if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else
...@@ -115,6 +117,7 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end, ...@@ -115,6 +117,7 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
if (*doc == FTB_DEC ) { param->plusminus--; continue; } else if (*doc == FTB_DEC ) { param->plusminus--; continue; } else
if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; } if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; }
} }
}
param->prev=*doc; param->prev=*doc;
param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0); param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
param->plusminus=param->pmsign=0; param->plusminus=param->pmsign=0;
...@@ -139,6 +142,11 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end, ...@@ -139,6 +142,11 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
return 1; return 1;
} }
} }
if (param->quot)
{
param->quot=*start=doc;
return 3; /* FTB_RBR */
}
return 0; return 0;
} }
......
...@@ -213,7 +213,7 @@ ERROR 42000: You have an error in your SQL syntax. Check the manual that corres ...@@ -213,7 +213,7 @@ ERROR 42000: You have an error in your SQL syntax. Check the manual that corres
create table t1 (a int); create table t1 (a int);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
update (select * from t1) as t1 set a = 5; update (select * from t1) as t1 set a = 5;
ERROR HY000: The target table t1 of the UPDATE is not updatable. ERROR HY000: The target table t1 of the UPDATE is not updatable
delete from (select * from t1); delete from (select * from t1);
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1 ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(select * from t1)' at line 1
insert into (select * from t1) values (5); insert into (select * from t1) values (5);
...@@ -264,7 +264,7 @@ N M ...@@ -264,7 +264,7 @@ N M
2 2 2 2
3 0 3 0
UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2; UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2;
ERROR HY000: The target table P2 of the UPDATE is not updatable. ERROR HY000: The target table P2 of the UPDATE is not updatable
UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2; UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
ERROR 42S22: Unknown column 'aaaa' in 'field list' ERROR 42S22: Unknown column 'aaaa' in 'field list'
delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N; delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
...@@ -272,7 +272,7 @@ select * from t1; ...@@ -272,7 +272,7 @@ select * from t1;
N M N M
3 0 3 0
delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N; delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
ERROR HY000: The target table P2 of the DELETE is not updatable. ERROR HY000: The target table P2 of the DELETE is not updatable
delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N; delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
ERROR 42S22: Unknown column 'aaa' in 'field list' ERROR 42S22: Unknown column 'aaa' in 'field list'
drop table t1; drop table t1;
......
...@@ -140,6 +140,9 @@ select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); ...@@ -140,6 +140,9 @@ select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE);
a b a b
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
a b a b
select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE);
a b
Full-text search in MySQL implements vector space model
select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE); select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE);
a b a b
Full-text search in MySQL implements vector space model Full-text search in MySQL implements vector space model
......
...@@ -125,11 +125,11 @@ Warning 1265 Using storage engine MyISAM for table 't1' ...@@ -125,11 +125,11 @@ Warning 1265 Using storage engine MyISAM for table 't1'
drop table t1; drop table t1;
create table t1 (id int) type=heap; create table t1 (id int) type=heap;
Warnings: Warnings:
Warning 1286 'TYPE=storage_engine' is deprecated. Use 'ENGINE=storage_engine' instead. Warning 1286 'TYPE=storage_engine' is deprecated, use 'ENGINE=storage_engine' instead
alter table t1 type=myisam; alter table t1 type=myisam;
Warnings: Warnings:
Warning 1286 'TYPE=storage_engine' is deprecated. Use 'ENGINE=storage_engine' instead. Warning 1286 'TYPE=storage_engine' is deprecated, use 'ENGINE=storage_engine' instead
drop table t1; drop table t1;
set table_type=MYISAM; set table_type=MYISAM;
Warnings: Warnings:
Warning 1286 'table_type' is deprecated. Use 'storage_engine' instead. Warning 1286 'table_type' is deprecated, use 'storage_engine' instead
...@@ -64,6 +64,10 @@ select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOL ...@@ -64,6 +64,10 @@ select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOL
select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
# bug#2708 crash
select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE);
# boolean w/o index: # boolean w/o index:
select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE); select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE);
......
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