mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
Merge bk-internal.mysql.com:/data0/bk/mysql-5.0
into bk-internal.mysql.com:/data0/bk/mysql-5.0-kt
This commit is contained in:
commit
a8839c53bc
3 changed files with 74 additions and 4 deletions
|
@ -1842,5 +1842,29 @@ a b
|
|||
select * from t1 where b like 'abc' or b like 'abc';
|
||||
a b
|
||||
3 abc
|
||||
drop table t1;
|
||||
create table t1 ( fname varchar(255), lname varchar(255) )
|
||||
engine=ndbcluster;
|
||||
insert into t1 values ("Young","Foo");
|
||||
set engine_condition_pushdown = 0;
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
set engine_condition_pushdown = 1;
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
insert into t1 values ("aaa", "aaa");
|
||||
insert into t1 values ("bbb", "bbb");
|
||||
insert into t1 values ("ccc", "ccc");
|
||||
insert into t1 values ("ddd", "ddd");
|
||||
set engine_condition_pushdown = 0;
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
set engine_condition_pushdown = 1;
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
fname lname
|
||||
Young Foo
|
||||
set engine_condition_pushdown = @old_ecpd;
|
||||
DROP TABLE t1,t2,t3,t4,t5;
|
||||
|
|
|
@ -1686,5 +1686,27 @@ select * from t1 where b like 'ab' or b like 'ab';
|
|||
select * from t1 where b like 'abc';
|
||||
select * from t1 where b like 'abc' or b like 'abc';
|
||||
|
||||
# bug#20406 (maybe same as bug#17421 -1, not seen on 32-bit x86)
|
||||
drop table t1;
|
||||
create table t1 ( fname varchar(255), lname varchar(255) )
|
||||
engine=ndbcluster;
|
||||
insert into t1 values ("Young","Foo");
|
||||
|
||||
set engine_condition_pushdown = 0;
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
set engine_condition_pushdown = 1;
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
|
||||
# make sure optimizer does not do some crazy shortcut
|
||||
insert into t1 values ("aaa", "aaa");
|
||||
insert into t1 values ("bbb", "bbb");
|
||||
insert into t1 values ("ccc", "ccc");
|
||||
insert into t1 values ("ddd", "ddd");
|
||||
|
||||
set engine_condition_pushdown = 0;
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
set engine_condition_pushdown = 1;
|
||||
SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%');
|
||||
|
||||
set engine_condition_pushdown = @old_ecpd;
|
||||
DROP TABLE t1,t2,t3,t4,t5;
|
||||
|
|
|
@ -4467,15 +4467,29 @@ int ha_ndbcluster::delete_table(const char *name)
|
|||
|
||||
int ha_ndbcluster::drop_table()
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
Ndb *ndb= get_ndb();
|
||||
NdbDictionary::Dictionary *dict= ndb->getDictionary();
|
||||
|
||||
DBUG_ENTER("drop_table");
|
||||
DBUG_PRINT("enter", ("Deleting %s", m_tabname));
|
||||
|
||||
|
||||
release_metadata();
|
||||
if (dict->dropTable(m_tabname))
|
||||
while (dict->dropTable(m_tabname))
|
||||
{
|
||||
const NdbError err= dict->getNdbError();
|
||||
switch (err.status)
|
||||
{
|
||||
case NdbError::TemporaryError:
|
||||
if (!thd->killed)
|
||||
continue; // retry indefinitly
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ERR_RETURN(dict->getNdbError());
|
||||
}
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -4884,14 +4898,24 @@ int ndbcluster_drop_database(const char *path)
|
|||
List_iterator_fast<char> it(drop_list);
|
||||
while ((tabname=it++))
|
||||
{
|
||||
if (dict->dropTable(tabname))
|
||||
while (dict->dropTable(tabname))
|
||||
{
|
||||
const NdbError err= dict->getNdbError();
|
||||
if (err.code != 709)
|
||||
switch (err.status)
|
||||
{
|
||||
case NdbError::TemporaryError:
|
||||
if (!thd->killed)
|
||||
continue; // retry indefinitly
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (err.code != 709) // 709: No such table existed
|
||||
{
|
||||
ERR_PRINT(err);
|
||||
ret= ndb_to_mysql_error(&err);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(ret);
|
||||
|
|
Loading…
Reference in a new issue