mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1 sql/field.cc: Auto merged storage/ndb/src/kernel/blocks/ERROR_codes.txt: Auto merged storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Auto merged storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: Auto merged storage/ndb/src/kernel/vm/Makefile.am: Auto merged strings/ctype-big5.c: Auto merged
This commit is contained in:
commit
99358698d3
18 changed files with 533 additions and 172 deletions
21
mysql-test/include/ctype_innodb_like.inc
Normal file
21
mysql-test/include/ctype_innodb_like.inc
Normal file
|
@ -0,0 +1,21 @@
|
|||
#
|
||||
# Bug#11650: LIKE pattern matching using prefix index
|
||||
# doesn't return correct result
|
||||
#
|
||||
--disable_warnings
|
||||
#
|
||||
# This query creates a column using
|
||||
# character_set_connection and
|
||||
# collation_connection.
|
||||
#
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
--enable_warnings
|
||||
alter table t1 add index(c1(5));
|
||||
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
drop table t1;
|
|
@ -67,6 +67,28 @@ big5_chinese_ci 6109
|
|||
big5_chinese_ci 61
|
||||
big5_chinese_ci 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
big5_chinese_ci
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
SET collation_connection='big5_bin';
|
||||
create table t1 select repeat('a',4000) a;
|
||||
delete from t1;
|
||||
|
@ -77,6 +99,28 @@ big5_bin 6109
|
|||
big5_bin 61
|
||||
big5_bin 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
big5_bin
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
SET NAMES big5;
|
||||
CREATE TABLE t1 (a text) character set big5;
|
||||
INSERT INTO t1 VALUES ('ùØ');
|
||||
|
|
|
@ -81,6 +81,28 @@ sjis_japanese_ci 6109
|
|||
sjis_japanese_ci 61
|
||||
sjis_japanese_ci 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
sjis_japanese_ci
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
SET collation_connection='sjis_bin';
|
||||
create table t1 select repeat('a',4000) a;
|
||||
delete from t1;
|
||||
|
@ -91,6 +113,28 @@ sjis_bin 6109
|
|||
sjis_bin 61
|
||||
sjis_bin 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
sjis_bin
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
SET NAMES sjis;
|
||||
SELECT HEX('佐淘 \圭') FROM DUAL;
|
||||
HEX('佐淘 \圭')
|
||||
|
|
|
@ -2217,6 +2217,28 @@ ujis_japanese_ci 6109
|
|||
ujis_japanese_ci 61
|
||||
ujis_japanese_ci 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
ujis_japanese_ci
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
SET collation_connection='ujis_bin';
|
||||
create table t1 select repeat('a',4000) a;
|
||||
delete from t1;
|
||||
|
@ -2227,3 +2249,25 @@ ujis_bin 6109
|
|||
ujis_bin 61
|
||||
ujis_bin 6120
|
||||
drop table t1;
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
alter table t1 add index(c1(5));
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
collation(c1)
|
||||
ujis_bin
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
c1
|
||||
abcdefg
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
c1
|
||||
abcde100
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
c1
|
||||
abcde110
|
||||
abcde111
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
c1
|
||||
abcde111
|
||||
drop table t1;
|
||||
|
|
|
@ -14,8 +14,10 @@ SET @test_collation= 'big5_chinese_ci';
|
|||
SET NAMES big5;
|
||||
SET collation_connection='big5_chinese_ci';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
SET collation_connection='big5_bin';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
|
||||
#
|
||||
# Bugs#9357: TEXT columns break string with special word in BIG5 charset.
|
||||
|
|
|
@ -66,8 +66,10 @@ drop table t1;
|
|||
|
||||
SET collation_connection='sjis_japanese_ci';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
SET collation_connection='sjis_bin';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
|
||||
# Check parsing of string literals in SJIS with multibyte characters that
|
||||
# have an embedded \ in them. (Bug #8303)
|
||||
|
|
|
@ -1145,5 +1145,7 @@ DROP TABLE t1;
|
|||
|
||||
SET collation_connection='ujis_japanese_ci';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
SET collation_connection='ujis_bin';
|
||||
-- source include/ctype_filesort.inc
|
||||
-- source include/ctype_innodb_like.inc
|
||||
|
|
10
sql/field.cc
10
sql/field.cc
|
@ -5185,20 +5185,20 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
|
|||
|
||||
int Field_date::store(double nr)
|
||||
{
|
||||
long tmp;
|
||||
longlong tmp;
|
||||
int error= 0;
|
||||
if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
|
||||
nr=floor(nr/1000000.0); // Timestamp to date
|
||||
if (nr < 0.0 || nr > 99991231.0)
|
||||
{
|
||||
tmp=0L;
|
||||
tmp= LL(0);
|
||||
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
|
||||
ER_WARN_DATA_OUT_OF_RANGE,
|
||||
nr, MYSQL_TIMESTAMP_DATE);
|
||||
error= 1;
|
||||
}
|
||||
else
|
||||
tmp=(long) rint(nr);
|
||||
tmp= (longlong) rint(nr);
|
||||
|
||||
return Field_date::store(tmp);
|
||||
}
|
||||
|
@ -6912,8 +6912,8 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
|
|||
|
||||
my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
|
||||
{
|
||||
char *blob;
|
||||
memcpy_fixed(&blob, ptr+packlength, sizeof(char*));
|
||||
const char *blob;
|
||||
memcpy_fixed(&blob, ptr+packlength, sizeof(const char*));
|
||||
if (!blob)
|
||||
blob= "";
|
||||
str2my_decimal(E_DEC_FATAL_ERROR, blob, get_length(ptr), charset(),
|
||||
|
|
|
@ -4,9 +4,9 @@ Next NDBFS 2000
|
|||
Next DBACC 3002
|
||||
Next DBTUP 4013
|
||||
Next DBLQH 5042
|
||||
Next DBDICT 6006
|
||||
Next DBDICT 6007
|
||||
Next DBDIH 7174
|
||||
Next DBTC 8035
|
||||
Next DBTC 8037
|
||||
Next CMVMI 9000
|
||||
Next BACKUP 10022
|
||||
Next DBUTIL 11002
|
||||
|
@ -408,10 +408,12 @@ Drop Table/Index:
|
|||
4001: Crash on REL_TABMEMREQ in TUP
|
||||
4002: Crash on DROP_TABFILEREQ in TUP
|
||||
4003: Fail next trigger create in TUP
|
||||
4004: Fail next trigger drop in TUP
|
||||
8033: Fail next trigger create in TC
|
||||
8034: Fail next index create in TC
|
||||
|
||||
|
||||
8035: Fail next trigger drop in TC
|
||||
8036: Fail next index drop in TC
|
||||
6006: Crash participant in create index
|
||||
|
||||
System Restart:
|
||||
---------------
|
||||
|
|
|
@ -6501,6 +6501,9 @@ void
|
|||
Dbdict::createIndex_slavePrepare(Signal* signal, OpCreateIndexPtr opPtr)
|
||||
{
|
||||
jam();
|
||||
if (ERROR_INSERTED(6006) && ! opPtr.p->m_isMaster) {
|
||||
ndbrequire(false);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -6813,14 +6816,16 @@ Dbdict::createIndex_sendReply(Signal* signal, OpCreateIndexPtr opPtr,
|
|||
CreateIndxRef* rep = (CreateIndxRef*)signal->getDataPtrSend();
|
||||
Uint32 gsn = GSN_CREATE_INDX_CONF;
|
||||
Uint32 length = CreateIndxConf::InternalLength;
|
||||
bool sendRef = opPtr.p->hasError();
|
||||
bool sendRef;
|
||||
if (! toUser) {
|
||||
sendRef = opPtr.p->hasLastError();
|
||||
rep->setUserRef(opPtr.p->m_coordinatorRef);
|
||||
rep->setConnectionPtr(opPtr.p->key);
|
||||
rep->setRequestType(opPtr.p->m_requestType);
|
||||
if (opPtr.p->m_requestType == CreateIndxReq::RT_DICT_ABORT)
|
||||
sendRef = false;
|
||||
} else {
|
||||
sendRef = opPtr.p->hasError();
|
||||
rep->setUserRef(opPtr.p->m_request.getUserRef());
|
||||
rep->setConnectionPtr(opPtr.p->m_request.getConnectionPtr());
|
||||
rep->setRequestType(opPtr.p->m_request.getRequestType());
|
||||
|
@ -6889,11 +6894,8 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (tmp.p->indexState == TableRecord::IS_DROPPING){
|
||||
jam();
|
||||
err = DropIndxRef::IndexNotFound;
|
||||
goto error;
|
||||
}
|
||||
if (tmp.p->indexState != TableRecord::IS_ONLINE)
|
||||
req->addRequestFlag(RequestFlag::RF_FORCE);
|
||||
|
||||
tmp.p->indexState = TableRecord::IS_DROPPING;
|
||||
|
||||
|
@ -7156,14 +7158,16 @@ Dbdict::dropIndex_sendReply(Signal* signal, OpDropIndexPtr opPtr,
|
|||
DropIndxRef* rep = (DropIndxRef*)signal->getDataPtrSend();
|
||||
Uint32 gsn = GSN_DROP_INDX_CONF;
|
||||
Uint32 length = DropIndxConf::InternalLength;
|
||||
bool sendRef = opPtr.p->hasError();
|
||||
bool sendRef;
|
||||
if (! toUser) {
|
||||
sendRef = opPtr.p->hasLastError();
|
||||
rep->setUserRef(opPtr.p->m_coordinatorRef);
|
||||
rep->setConnectionPtr(opPtr.p->key);
|
||||
rep->setRequestType(opPtr.p->m_requestType);
|
||||
if (opPtr.p->m_requestType == DropIndxReq::RT_DICT_ABORT)
|
||||
sendRef = false;
|
||||
} else {
|
||||
sendRef = opPtr.p->hasError();
|
||||
rep->setUserRef(opPtr.p->m_request.getUserRef());
|
||||
rep->setConnectionPtr(opPtr.p->m_request.getConnectionPtr());
|
||||
rep->setRequestType(opPtr.p->m_request.getRequestType());
|
||||
|
@ -9680,7 +9684,7 @@ Dbdict::alterIndex_fromCreateTc(Signal* signal, OpAlterIndexPtr opPtr)
|
|||
{
|
||||
jam();
|
||||
// mark created in local TC
|
||||
if (! opPtr.p->hasError()) {
|
||||
if (! opPtr.p->hasLastError()) {
|
||||
TableRecordPtr indexPtr;
|
||||
c_tableRecordPool.getPtr(indexPtr, opPtr.p->m_request.getIndexId());
|
||||
indexPtr.p->indexLocal |= TableRecord::IL_CREATED_TC;
|
||||
|
@ -9696,9 +9700,10 @@ Dbdict::alterIndex_toDropTc(Signal* signal, OpAlterIndexPtr opPtr)
|
|||
jam();
|
||||
TableRecordPtr indexPtr;
|
||||
c_tableRecordPool.getPtr(indexPtr, opPtr.p->m_request.getIndexId());
|
||||
// broken index
|
||||
// broken index allowed if force
|
||||
if (! (indexPtr.p->indexLocal & TableRecord::IL_CREATED_TC)) {
|
||||
jam();
|
||||
ndbassert(opPtr.p->m_requestFlag & RequestFlag::RF_FORCE);
|
||||
alterIndex_sendReply(signal, opPtr, false);
|
||||
return;
|
||||
}
|
||||
|
@ -9720,8 +9725,8 @@ Dbdict::alterIndex_fromDropTc(Signal* signal, OpAlterIndexPtr opPtr)
|
|||
{
|
||||
jam();
|
||||
ndbrequire(opPtr.p->m_requestType == AlterIndxReq::RT_DICT_TC);
|
||||
if (! opPtr.p->hasError()) {
|
||||
// mark dropped in local TC
|
||||
// mark dropped locally
|
||||
if (! opPtr.p->hasLastError()) {
|
||||
TableRecordPtr indexPtr;
|
||||
c_tableRecordPool.getPtr(indexPtr, opPtr.p->m_request.getIndexId());
|
||||
indexPtr.p->indexLocal &= ~TableRecord::IL_CREATED_TC;
|
||||
|
@ -9859,51 +9864,46 @@ Dbdict::alterIndex_toDropTrigger(Signal* signal, OpAlterIndexPtr opPtr)
|
|||
req->setUserRef(reference());
|
||||
req->setConnectionPtr(opPtr.p->key);
|
||||
req->setRequestType(DropTrigReq::RT_ALTER_INDEX);
|
||||
req->addRequestFlag(opPtr.p->m_requestFlag);
|
||||
req->setTableId(opPtr.p->m_request.getTableId());
|
||||
req->setIndexId(opPtr.p->m_request.getIndexId());
|
||||
req->setTriggerInfo(0); // not used
|
||||
opPtr.p->m_triggerCounter = 0;
|
||||
// insert
|
||||
if (indexPtr.p->insertTriggerId != RNIL) {
|
||||
if (indexPtr.p->isHashIndex()) {
|
||||
// insert
|
||||
req->setTriggerId(indexPtr.p->insertTriggerId);
|
||||
sendSignal(reference(), GSN_DROP_TRIG_REQ,
|
||||
signal, DropTrigReq::SignalLength, JBB);
|
||||
opPtr.p->m_triggerCounter++;
|
||||
}
|
||||
// update
|
||||
if (indexPtr.p->updateTriggerId != RNIL) {
|
||||
// update
|
||||
req->setTriggerId(indexPtr.p->updateTriggerId);
|
||||
sendSignal(reference(), GSN_DROP_TRIG_REQ,
|
||||
signal, DropTrigReq::SignalLength, JBB);
|
||||
opPtr.p->m_triggerCounter++;
|
||||
}
|
||||
// delete
|
||||
if (indexPtr.p->deleteTriggerId != RNIL) {
|
||||
// delete
|
||||
req->setTriggerId(indexPtr.p->deleteTriggerId);
|
||||
sendSignal(reference(), GSN_DROP_TRIG_REQ,
|
||||
signal, DropTrigReq::SignalLength, JBB);
|
||||
opPtr.p->m_triggerCounter++;
|
||||
// build
|
||||
if (indexPtr.p->buildTriggerId != RNIL) {
|
||||
req->setTriggerId(indexPtr.p->buildTriggerId);
|
||||
sendSignal(reference(), GSN_DROP_TRIG_REQ,
|
||||
signal, DropTrigReq::SignalLength, JBB);
|
||||
opPtr.p->m_triggerCounter++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// custom
|
||||
if (indexPtr.p->customTriggerId != RNIL) {
|
||||
if (indexPtr.p->isOrderedIndex()) {
|
||||
// custom
|
||||
req->addRequestFlag(RequestFlag::RF_NOTCTRIGGER);
|
||||
req->setTriggerId(indexPtr.p->customTriggerId);
|
||||
sendSignal(reference(), GSN_DROP_TRIG_REQ,
|
||||
signal, DropTrigReq::SignalLength, JBB);
|
||||
opPtr.p->m_triggerCounter++;
|
||||
return;
|
||||
}
|
||||
// build
|
||||
if (indexPtr.p->buildTriggerId != RNIL) {
|
||||
req->setTriggerId(indexPtr.p->buildTriggerId);
|
||||
sendSignal(reference(), GSN_DROP_TRIG_REQ,
|
||||
signal, DropTrigReq::SignalLength, JBB);
|
||||
opPtr.p->m_triggerCounter++;
|
||||
}
|
||||
if (opPtr.p->m_triggerCounter == 0) {
|
||||
// drop in each TC
|
||||
jam();
|
||||
opPtr.p->m_requestType = AlterIndxReq::RT_DICT_TC;
|
||||
alterIndex_sendSlaveReq(signal, opPtr);
|
||||
}
|
||||
ndbrequire(false);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -10021,14 +10021,16 @@ Dbdict::alterIndex_sendReply(Signal* signal, OpAlterIndexPtr opPtr,
|
|||
AlterIndxRef* rep = (AlterIndxRef*)signal->getDataPtrSend();
|
||||
Uint32 gsn = GSN_ALTER_INDX_CONF;
|
||||
Uint32 length = AlterIndxConf::InternalLength;
|
||||
bool sendRef = opPtr.p->hasError();
|
||||
bool sendRef;
|
||||
if (! toUser) {
|
||||
sendRef = opPtr.p->hasLastError();
|
||||
rep->setUserRef(opPtr.p->m_coordinatorRef);
|
||||
rep->setConnectionPtr(opPtr.p->key);
|
||||
rep->setRequestType(opPtr.p->m_requestType);
|
||||
if (opPtr.p->m_requestType == AlterIndxReq::RT_DICT_ABORT)
|
||||
sendRef = false;
|
||||
} else {
|
||||
sendRef = opPtr.p->hasError();
|
||||
rep->setUserRef(opPtr.p->m_request.getUserRef());
|
||||
rep->setConnectionPtr(opPtr.p->m_request.getConnectionPtr());
|
||||
rep->setRequestType(opPtr.p->m_request.getRequestType());
|
||||
|
@ -10441,8 +10443,10 @@ Dbdict::buildIndex_toOnline(Signal* signal, OpBuildIndexPtr opPtr)
|
|||
req->setUserRef(reference());
|
||||
req->setConnectionPtr(opPtr.p->key);
|
||||
if (opPtr.p->m_requestType == BuildIndxReq::RT_DICT_TC) {
|
||||
jam();
|
||||
req->setRequestType(AlterIndxReq::RT_TC);
|
||||
} else if (opPtr.p->m_requestType == BuildIndxReq::RT_DICT_TUX) {
|
||||
jam();
|
||||
req->setRequestType(AlterIndxReq::RT_TUX);
|
||||
} else {
|
||||
ndbrequire(false);
|
||||
|
@ -10453,8 +10457,10 @@ Dbdict::buildIndex_toOnline(Signal* signal, OpBuildIndexPtr opPtr)
|
|||
req->setOnline(true);
|
||||
BlockReference blockRef = 0;
|
||||
if (opPtr.p->m_requestType == BuildIndxReq::RT_DICT_TC) {
|
||||
jam();
|
||||
blockRef = calcTcBlockRef(getOwnNodeId());
|
||||
} else if (opPtr.p->m_requestType == BuildIndxReq::RT_DICT_TUX) {
|
||||
jam();
|
||||
blockRef = calcTuxBlockRef(getOwnNodeId());
|
||||
} else {
|
||||
ndbrequire(false);
|
||||
|
@ -10481,15 +10487,14 @@ Dbdict::buildIndex_sendSlaveReq(Signal* signal, OpBuildIndexPtr opPtr)
|
|||
req->setConnectionPtr(opPtr.p->key);
|
||||
req->setRequestType(opPtr.p->m_requestType);
|
||||
req->addRequestFlag(opPtr.p->m_requestFlag);
|
||||
if(opPtr.p->m_requestFlag & RequestFlag::RF_LOCAL)
|
||||
{
|
||||
if(opPtr.p->m_requestFlag & RequestFlag::RF_LOCAL) {
|
||||
jam();
|
||||
opPtr.p->m_signalCounter.clearWaitingFor();
|
||||
opPtr.p->m_signalCounter.setWaitingFor(getOwnNodeId());
|
||||
sendSignal(reference(), GSN_BUILDINDXREQ,
|
||||
signal, BuildIndxReq::SignalLength, JBB);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
jam();
|
||||
opPtr.p->m_signalCounter = c_aliveNodes;
|
||||
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
|
||||
sendSignal(rg, GSN_BUILDINDXREQ,
|
||||
|
@ -10504,14 +10509,16 @@ Dbdict::buildIndex_sendReply(Signal* signal, OpBuildIndexPtr opPtr,
|
|||
BuildIndxRef* rep = (BuildIndxRef*)signal->getDataPtrSend();
|
||||
Uint32 gsn = GSN_BUILDINDXCONF;
|
||||
Uint32 length = BuildIndxConf::InternalLength;
|
||||
bool sendRef = opPtr.p->hasError();
|
||||
bool sendRef;
|
||||
if (! toUser) {
|
||||
sendRef = opPtr.p->hasLastError();
|
||||
rep->setUserRef(opPtr.p->m_coordinatorRef);
|
||||
rep->setConnectionPtr(opPtr.p->key);
|
||||
rep->setRequestType(opPtr.p->m_requestType);
|
||||
if (opPtr.p->m_requestType == BuildIndxReq::RT_DICT_ABORT)
|
||||
sendRef = false;
|
||||
} else {
|
||||
sendRef = opPtr.p->hasError();
|
||||
rep->setUserRef(opPtr.p->m_request.getUserRef());
|
||||
rep->setConnectionPtr(opPtr.p->m_request.getConnectionPtr());
|
||||
rep->setRequestType(opPtr.p->m_request.getRequestType());
|
||||
|
@ -10997,14 +11004,16 @@ Dbdict::createTrigger_sendReply(Signal* signal, OpCreateTriggerPtr opPtr,
|
|||
CreateTrigRef* rep = (CreateTrigRef*)signal->getDataPtrSend();
|
||||
Uint32 gsn = GSN_CREATE_TRIG_CONF;
|
||||
Uint32 length = CreateTrigConf::InternalLength;
|
||||
bool sendRef = opPtr.p->hasError();
|
||||
bool sendRef;
|
||||
if (! toUser) {
|
||||
sendRef = opPtr.p->hasLastError();
|
||||
rep->setUserRef(opPtr.p->m_coordinatorRef);
|
||||
rep->setConnectionPtr(opPtr.p->key);
|
||||
rep->setRequestType(opPtr.p->m_requestType);
|
||||
if (opPtr.p->m_requestType == CreateTrigReq::RT_DICT_ABORT)
|
||||
sendRef = false;
|
||||
} else {
|
||||
sendRef = opPtr.p->hasError();
|
||||
rep->setUserRef(opPtr.p->m_request.getUserRef());
|
||||
rep->setConnectionPtr(opPtr.p->m_request.getConnectionPtr());
|
||||
rep->setRequestType(opPtr.p->m_request.getRequestType());
|
||||
|
@ -11092,8 +11101,10 @@ Dbdict::execDROP_TRIG_REQ(Signal* signal)
|
|||
OpDropTrigger opBad;
|
||||
opPtr.p = &opBad;
|
||||
opPtr.p->save(req);
|
||||
opPtr.p->m_errorCode = DropTrigRef::TriggerNotFound;
|
||||
opPtr.p->m_errorLine = __LINE__;
|
||||
if (! (req->getRequestFlag() & RequestFlag::RF_FORCE)) {
|
||||
opPtr.p->m_errorCode = DropTrigRef::TriggerNotFound;
|
||||
opPtr.p->m_errorLine = __LINE__;
|
||||
}
|
||||
dropTrigger_sendReply(signal, opPtr, true);
|
||||
return;
|
||||
}
|
||||
|
@ -11260,6 +11271,7 @@ Dbdict::dropTrigger_toAlterTrigger(Signal* signal, OpDropTriggerPtr opPtr)
|
|||
req->setUserRef(reference());
|
||||
req->setConnectionPtr(opPtr.p->key);
|
||||
req->setRequestType(AlterTrigReq::RT_DROP_TRIGGER);
|
||||
req->addRequestFlag(opPtr.p->m_requestFlag);
|
||||
req->setTableId(opPtr.p->m_request.getTableId());
|
||||
req->setTriggerId(opPtr.p->m_request.getTriggerId());
|
||||
req->setTriggerInfo(0); // not used
|
||||
|
@ -11355,14 +11367,16 @@ Dbdict::dropTrigger_sendReply(Signal* signal, OpDropTriggerPtr opPtr,
|
|||
DropTrigRef* rep = (DropTrigRef*)signal->getDataPtrSend();
|
||||
Uint32 gsn = GSN_DROP_TRIG_CONF;
|
||||
Uint32 length = DropTrigConf::InternalLength;
|
||||
bool sendRef = opPtr.p->hasError();
|
||||
bool sendRef;
|
||||
if (! toUser) {
|
||||
sendRef = opPtr.p->hasLastError();
|
||||
rep->setUserRef(opPtr.p->m_coordinatorRef);
|
||||
rep->setConnectionPtr(opPtr.p->key);
|
||||
rep->setRequestType(opPtr.p->m_requestType);
|
||||
if (opPtr.p->m_requestType == DropTrigReq::RT_DICT_ABORT)
|
||||
sendRef = false;
|
||||
} else {
|
||||
sendRef = opPtr.p->hasError();
|
||||
rep->setUserRef(opPtr.p->m_request.getUserRef());
|
||||
rep->setConnectionPtr(opPtr.p->m_request.getConnectionPtr());
|
||||
rep->setRequestType(opPtr.p->m_request.getRequestType());
|
||||
|
@ -11586,28 +11600,37 @@ Dbdict::alterTrigger_recvReply(Signal* signal, const AlterTrigConf* conf,
|
|||
if (! (opPtr.p->m_request.getRequestFlag() & RequestFlag::RF_NOTCTRIGGER)) {
|
||||
if (requestType == AlterTrigReq::RT_DICT_PREPARE) {
|
||||
jam();
|
||||
if (opPtr.p->m_request.getOnline())
|
||||
if (opPtr.p->m_request.getOnline()) {
|
||||
jam();
|
||||
opPtr.p->m_requestType = AlterTrigReq::RT_DICT_TC;
|
||||
else
|
||||
} else {
|
||||
jam();
|
||||
opPtr.p->m_requestType = AlterTrigReq::RT_DICT_LQH;
|
||||
}
|
||||
alterTrigger_sendSlaveReq(signal, opPtr);
|
||||
return;
|
||||
}
|
||||
if (requestType == AlterTrigReq::RT_DICT_TC) {
|
||||
jam();
|
||||
if (opPtr.p->m_request.getOnline())
|
||||
if (opPtr.p->m_request.getOnline()) {
|
||||
jam();
|
||||
opPtr.p->m_requestType = AlterTrigReq::RT_DICT_LQH;
|
||||
else
|
||||
} else {
|
||||
jam();
|
||||
opPtr.p->m_requestType = AlterTrigReq::RT_DICT_COMMIT;
|
||||
}
|
||||
alterTrigger_sendSlaveReq(signal, opPtr);
|
||||
return;
|
||||
}
|
||||
if (requestType == AlterTrigReq::RT_DICT_LQH) {
|
||||
jam();
|
||||
if (opPtr.p->m_request.getOnline())
|
||||
if (opPtr.p->m_request.getOnline()) {
|
||||
jam();
|
||||
opPtr.p->m_requestType = AlterTrigReq::RT_DICT_COMMIT;
|
||||
else
|
||||
} else {
|
||||
jam();
|
||||
opPtr.p->m_requestType = AlterTrigReq::RT_DICT_TC;
|
||||
}
|
||||
alterTrigger_sendSlaveReq(signal, opPtr);
|
||||
return;
|
||||
}
|
||||
|
@ -11662,8 +11685,10 @@ Dbdict::alterTrigger_toCreateLocal(Signal* signal, OpAlterTriggerPtr opPtr)
|
|||
req->setUserRef(reference());
|
||||
req->setConnectionPtr(opPtr.p->key);
|
||||
if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_TC) {
|
||||
jam();
|
||||
req->setRequestType(CreateTrigReq::RT_TC);
|
||||
} else if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_LQH) {
|
||||
jam();
|
||||
req->setRequestType(CreateTrigReq::RT_LQH);
|
||||
} else {
|
||||
ndbassert(false);
|
||||
|
@ -11680,8 +11705,10 @@ Dbdict::alterTrigger_toCreateLocal(Signal* signal, OpAlterTriggerPtr opPtr)
|
|||
req->setReceiverRef(opPtr.p->m_request.getReceiverRef());
|
||||
BlockReference blockRef = 0;
|
||||
if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_TC) {
|
||||
jam();
|
||||
blockRef = calcTcBlockRef(getOwnNodeId());
|
||||
} else if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_LQH) {
|
||||
jam();
|
||||
blockRef = calcLqhBlockRef(getOwnNodeId());
|
||||
} else {
|
||||
ndbassert(false);
|
||||
|
@ -11695,13 +11722,15 @@ void
|
|||
Dbdict::alterTrigger_fromCreateLocal(Signal* signal, OpAlterTriggerPtr opPtr)
|
||||
{
|
||||
jam();
|
||||
if (! opPtr.p->hasError()) {
|
||||
if (! opPtr.p->hasLastError()) {
|
||||
// mark created locally
|
||||
TriggerRecordPtr triggerPtr;
|
||||
c_triggerRecordPool.getPtr(triggerPtr, opPtr.p->m_request.getTriggerId());
|
||||
if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_TC) {
|
||||
jam();
|
||||
triggerPtr.p->triggerLocal |= TriggerRecord::TL_CREATED_TC;
|
||||
} else if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_LQH) {
|
||||
jam();
|
||||
triggerPtr.p->triggerLocal |= TriggerRecord::TL_CREATED_LQH;
|
||||
} else {
|
||||
ndbrequire(false);
|
||||
|
@ -11721,17 +11750,21 @@ Dbdict::alterTrigger_toDropLocal(Signal* signal, OpAlterTriggerPtr opPtr)
|
|||
req->setUserRef(reference());
|
||||
req->setConnectionPtr(opPtr.p->key);
|
||||
if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_TC) {
|
||||
// broken trigger
|
||||
jam();
|
||||
// broken trigger allowed if force
|
||||
if (! (triggerPtr.p->triggerLocal & TriggerRecord::TL_CREATED_TC)) {
|
||||
jam();
|
||||
ndbassert(opPtr.p->m_requestFlag & RequestFlag::RF_FORCE);
|
||||
alterTrigger_sendReply(signal, opPtr, false);
|
||||
return;
|
||||
}
|
||||
req->setRequestType(DropTrigReq::RT_TC);
|
||||
} else if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_LQH) {
|
||||
// broken trigger
|
||||
jam();
|
||||
// broken trigger allowed if force
|
||||
if (! (triggerPtr.p->triggerLocal & TriggerRecord::TL_CREATED_LQH)) {
|
||||
jam();
|
||||
ndbassert(opPtr.p->m_requestFlag & RequestFlag::RF_FORCE);
|
||||
alterTrigger_sendReply(signal, opPtr, false);
|
||||
return;
|
||||
}
|
||||
|
@ -11749,8 +11782,10 @@ Dbdict::alterTrigger_toDropLocal(Signal* signal, OpAlterTriggerPtr opPtr)
|
|||
req->setMonitorAllAttributes(triggerPtr.p->monitorAllAttributes);
|
||||
BlockReference blockRef = 0;
|
||||
if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_TC) {
|
||||
jam();
|
||||
blockRef = calcTcBlockRef(getOwnNodeId());
|
||||
} else if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_LQH) {
|
||||
jam();
|
||||
blockRef = calcLqhBlockRef(getOwnNodeId());
|
||||
} else {
|
||||
ndbassert(false);
|
||||
|
@ -11763,13 +11798,15 @@ void
|
|||
Dbdict::alterTrigger_fromDropLocal(Signal* signal, OpAlterTriggerPtr opPtr)
|
||||
{
|
||||
jam();
|
||||
if (! opPtr.p->hasError()) {
|
||||
if (! opPtr.p->hasLastError()) {
|
||||
// mark dropped locally
|
||||
TriggerRecordPtr triggerPtr;
|
||||
c_triggerRecordPool.getPtr(triggerPtr, opPtr.p->m_request.getTriggerId());
|
||||
if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_TC) {
|
||||
jam();
|
||||
triggerPtr.p->triggerLocal &= ~TriggerRecord::TL_CREATED_TC;
|
||||
} else if (opPtr.p->m_requestType == AlterTrigReq::RT_DICT_LQH) {
|
||||
jam();
|
||||
triggerPtr.p->triggerLocal &= ~TriggerRecord::TL_CREATED_LQH;
|
||||
} else {
|
||||
ndbrequire(false);
|
||||
|
@ -11826,8 +11863,9 @@ Dbdict::alterTrigger_sendReply(Signal* signal, OpAlterTriggerPtr opPtr,
|
|||
AlterTrigRef* rep = (AlterTrigRef*)signal->getDataPtrSend();
|
||||
Uint32 gsn = GSN_ALTER_TRIG_CONF;
|
||||
Uint32 length = AlterTrigConf::InternalLength;
|
||||
bool sendRef = opPtr.p->hasError();
|
||||
bool sendRef;
|
||||
if (! toUser) {
|
||||
sendRef = opPtr.p->hasLastError();
|
||||
rep->setUserRef(opPtr.p->m_coordinatorRef);
|
||||
rep->setConnectionPtr(opPtr.p->key);
|
||||
rep->setRequestType(opPtr.p->m_requestType);
|
||||
|
@ -11838,6 +11876,7 @@ Dbdict::alterTrigger_sendReply(Signal* signal, OpAlterTriggerPtr opPtr,
|
|||
jam();
|
||||
}
|
||||
} else {
|
||||
sendRef = opPtr.p->hasError();
|
||||
jam();
|
||||
rep->setUserRef(opPtr.p->m_request.getUserRef());
|
||||
rep->setConnectionPtr(opPtr.p->m_request.getConnectionPtr());
|
||||
|
|
|
@ -957,7 +957,8 @@ private:
|
|||
enum {
|
||||
RF_LOCAL = 1 << 0, // create on local node only
|
||||
RF_NOBUILD = 1 << 1, // no need to build index
|
||||
RF_NOTCTRIGGER = 1 << 2 // alter trigger: no trigger in TC
|
||||
RF_NOTCTRIGGER = 1 << 2, // alter trigger: no trigger in TC
|
||||
RF_FORCE = 1 << 4 // force drop
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -977,6 +978,7 @@ private:
|
|||
CreateIndxReq::RequestType m_requestType;
|
||||
Uint32 m_requestFlag;
|
||||
// error info
|
||||
CreateIndxRef::ErrorCode m_lastError;
|
||||
CreateIndxRef::ErrorCode m_errorCode;
|
||||
Uint32 m_errorLine;
|
||||
Uint32 m_errorNode;
|
||||
|
@ -988,6 +990,7 @@ private:
|
|||
m_coordinatorRef = 0;
|
||||
m_requestType = CreateIndxReq::RT_UNDEFINED;
|
||||
m_requestFlag = 0;
|
||||
m_lastError = CreateIndxRef::NoError;
|
||||
m_errorCode = CreateIndxRef::NoError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
|
@ -997,34 +1000,49 @@ private:
|
|||
m_requestType = req->getRequestType();
|
||||
m_requestFlag = req->getRequestFlag();
|
||||
}
|
||||
bool hasLastError() {
|
||||
return m_lastError != CreateIndxRef::NoError;
|
||||
}
|
||||
bool hasError() {
|
||||
return m_errorCode != CreateIndxRef::NoError;
|
||||
}
|
||||
void setError(const CreateIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = CreateIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const CreateTableRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_lastError = CreateIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
switch (ref->getErrorCode()) {
|
||||
case CreateTableRef::TableAlreadyExist:
|
||||
m_errorCode = CreateIndxRef::IndexExists;
|
||||
m_lastError = CreateIndxRef::IndexExists;
|
||||
break;
|
||||
default:
|
||||
m_errorCode = (CreateIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_lastError = (CreateIndxRef::ErrorCode)ref->getErrorCode();
|
||||
break;
|
||||
}
|
||||
m_errorLine = ref->getErrorLine();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const AlterIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (CreateIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = CreateIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (CreateIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1043,6 +1061,7 @@ private:
|
|||
DropIndxReq::RequestType m_requestType;
|
||||
Uint32 m_requestFlag;
|
||||
// error info
|
||||
DropIndxRef::ErrorCode m_lastError;
|
||||
DropIndxRef::ErrorCode m_errorCode;
|
||||
Uint32 m_errorLine;
|
||||
Uint32 m_errorNode;
|
||||
|
@ -1054,6 +1073,7 @@ private:
|
|||
m_coordinatorRef = 0;
|
||||
m_requestType = DropIndxReq::RT_UNDEFINED;
|
||||
m_requestFlag = 0;
|
||||
m_lastError = DropIndxRef::NoError;
|
||||
m_errorCode = DropIndxRef::NoError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
|
@ -1063,44 +1083,59 @@ private:
|
|||
m_requestType = req->getRequestType();
|
||||
m_requestFlag = req->getRequestFlag();
|
||||
}
|
||||
bool hasLastError() {
|
||||
return m_lastError != DropIndxRef::NoError;
|
||||
}
|
||||
bool hasError() {
|
||||
return m_errorCode != DropIndxRef::NoError;
|
||||
}
|
||||
void setError(const DropIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = DropIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const AlterIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (DropIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = DropIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (DropIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const DropTableRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
switch(ref->errorCode) {
|
||||
case(DropTableRef::Busy):
|
||||
m_errorCode = DropIndxRef::Busy;
|
||||
m_lastError = DropIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
switch (ref->errorCode) {
|
||||
case DropTableRef::Busy:
|
||||
m_lastError = DropIndxRef::Busy;
|
||||
break;
|
||||
case(DropTableRef::NoSuchTable):
|
||||
m_errorCode = DropIndxRef::IndexNotFound;
|
||||
case DropTableRef::NoSuchTable:
|
||||
m_lastError = DropIndxRef::IndexNotFound;
|
||||
break;
|
||||
case(DropTableRef::DropInProgress):
|
||||
m_errorCode = DropIndxRef::Busy;
|
||||
case DropTableRef::DropInProgress:
|
||||
m_lastError = DropIndxRef::Busy;
|
||||
break;
|
||||
case(DropTableRef::NoDropTableRecordAvailable):
|
||||
m_errorCode = DropIndxRef::Busy;
|
||||
case DropTableRef::NoDropTableRecordAvailable:
|
||||
m_lastError = DropIndxRef::Busy;
|
||||
break;
|
||||
default:
|
||||
m_errorCode = (DropIndxRef::ErrorCode)ref->errorCode;
|
||||
m_lastError = (DropIndxRef::ErrorCode)ref->errorCode;
|
||||
break;
|
||||
}
|
||||
//m_errorLine = ref->getErrorLine();
|
||||
//m_errorNode = ref->getErrorNode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1121,6 +1156,7 @@ private:
|
|||
AlterIndxReq::RequestType m_requestType;
|
||||
Uint32 m_requestFlag;
|
||||
// error info
|
||||
AlterIndxRef::ErrorCode m_lastError;
|
||||
AlterIndxRef::ErrorCode m_errorCode;
|
||||
Uint32 m_errorLine;
|
||||
Uint32 m_errorNode;
|
||||
|
@ -1133,6 +1169,7 @@ private:
|
|||
m_coordinatorRef = 0;
|
||||
m_requestType = AlterIndxReq::RT_UNDEFINED;
|
||||
m_requestFlag = 0;
|
||||
m_lastError = AlterIndxRef::NoError;
|
||||
m_errorCode = AlterIndxRef::NoError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
|
@ -1143,47 +1180,76 @@ private:
|
|||
m_requestType = req->getRequestType();
|
||||
m_requestFlag = req->getRequestFlag();
|
||||
}
|
||||
bool hasLastError() {
|
||||
return m_lastError != AlterIndxRef::NoError;
|
||||
}
|
||||
bool hasError() {
|
||||
return m_errorCode != AlterIndxRef::NoError;
|
||||
}
|
||||
void setError(const AlterIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = AlterIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const CreateIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = AlterIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const DropIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = AlterIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const BuildIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_lastError = AlterIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const CreateTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = AlterIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const DropTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = AlterIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1205,6 +1271,7 @@ private:
|
|||
Uint32 m_requestFlag;
|
||||
Uint32 m_constrTriggerId;
|
||||
// error info
|
||||
BuildIndxRef::ErrorCode m_lastError;
|
||||
BuildIndxRef::ErrorCode m_errorCode;
|
||||
Uint32 m_errorLine;
|
||||
Uint32 m_errorNode;
|
||||
|
@ -1216,7 +1283,7 @@ private:
|
|||
m_coordinatorRef = 0;
|
||||
m_requestType = BuildIndxReq::RT_UNDEFINED;
|
||||
m_requestFlag = 0;
|
||||
// Uint32 m_constrTriggerId = RNIL;
|
||||
m_lastError = BuildIndxRef::NoError;
|
||||
m_errorCode = BuildIndxRef::NoError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
|
@ -1226,33 +1293,54 @@ private:
|
|||
m_requestType = req->getRequestType();
|
||||
m_requestFlag = req->getRequestFlag();
|
||||
}
|
||||
bool hasLastError() {
|
||||
return m_lastError != BuildIndxRef::NoError;
|
||||
}
|
||||
bool hasError() {
|
||||
return m_errorCode != BuildIndxRef::NoError;
|
||||
}
|
||||
void setError(const BuildIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = ref->getErrorCode();
|
||||
m_lastError = BuildIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const AlterIndxRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (BuildIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = BuildIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (BuildIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const CreateTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (BuildIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = BuildIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (BuildIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const DropTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (BuildIndxRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = BuildIndxRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (BuildIndxRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1385,6 +1473,7 @@ private:
|
|||
CreateTrigReq::RequestType m_requestType;
|
||||
Uint32 m_requestFlag;
|
||||
// error info
|
||||
CreateTrigRef::ErrorCode m_lastError;
|
||||
CreateTrigRef::ErrorCode m_errorCode;
|
||||
Uint32 m_errorLine;
|
||||
Uint32 m_errorNode;
|
||||
|
@ -1396,6 +1485,7 @@ private:
|
|||
m_coordinatorRef = 0;
|
||||
m_requestType = CreateTrigReq::RT_UNDEFINED;
|
||||
m_requestFlag = 0;
|
||||
m_lastError = CreateTrigRef::NoError;
|
||||
m_errorCode = CreateTrigRef::NoError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
|
@ -1405,21 +1495,32 @@ private:
|
|||
m_requestType = req->getRequestType();
|
||||
m_requestFlag = req->getRequestFlag();
|
||||
}
|
||||
bool hasLastError() {
|
||||
return m_lastError != CreateTrigRef::NoError;
|
||||
}
|
||||
bool hasError() {
|
||||
return m_errorCode != CreateTrigRef::NoError;
|
||||
}
|
||||
void setError(const CreateTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = CreateTrigRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const AlterTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (CreateTrigRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = CreateTrigRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (CreateTrigRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1438,6 +1539,7 @@ private:
|
|||
DropTrigReq::RequestType m_requestType;
|
||||
Uint32 m_requestFlag;
|
||||
// error info
|
||||
DropTrigRef::ErrorCode m_lastError;
|
||||
DropTrigRef::ErrorCode m_errorCode;
|
||||
Uint32 m_errorLine;
|
||||
Uint32 m_errorNode;
|
||||
|
@ -1449,6 +1551,7 @@ private:
|
|||
m_coordinatorRef = 0;
|
||||
m_requestType = DropTrigReq::RT_UNDEFINED;
|
||||
m_requestFlag = 0;
|
||||
m_lastError = DropTrigRef::NoError;
|
||||
m_errorCode = DropTrigRef::NoError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
|
@ -1458,21 +1561,32 @@ private:
|
|||
m_requestType = req->getRequestType();
|
||||
m_requestFlag = req->getRequestFlag();
|
||||
}
|
||||
bool hasLastError() {
|
||||
return m_lastError != DropTrigRef::NoError;
|
||||
}
|
||||
bool hasError() {
|
||||
return m_errorCode != DropTrigRef::NoError;
|
||||
}
|
||||
void setError(const DropTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = DropTrigRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const AlterTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (DropTrigRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = DropTrigRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (DropTrigRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1493,6 +1607,7 @@ private:
|
|||
AlterTrigReq::RequestType m_requestType;
|
||||
Uint32 m_requestFlag;
|
||||
// error info
|
||||
AlterTrigRef::ErrorCode m_lastError;
|
||||
AlterTrigRef::ErrorCode m_errorCode;
|
||||
Uint32 m_errorLine;
|
||||
Uint32 m_errorNode;
|
||||
|
@ -1504,6 +1619,7 @@ private:
|
|||
m_coordinatorRef = 0;
|
||||
m_requestType = AlterTrigReq::RT_UNDEFINED;
|
||||
m_requestFlag = 0;
|
||||
m_lastError = AlterTrigRef::NoError;
|
||||
m_errorCode = AlterTrigRef::NoError;
|
||||
m_errorLine = 0;
|
||||
m_errorNode = 0;
|
||||
|
@ -1513,28 +1629,43 @@ private:
|
|||
m_requestType = req->getRequestType();
|
||||
m_requestFlag = req->getRequestFlag();
|
||||
}
|
||||
bool hasLastError() {
|
||||
return m_lastError != AlterTrigRef::NoError;
|
||||
}
|
||||
bool hasError() {
|
||||
return m_errorCode != AlterTrigRef::NoError;
|
||||
}
|
||||
void setError(const AlterTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (AlterTrigRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = AlterTrigRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (AlterTrigRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const CreateTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (AlterTrigRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = AlterTrigRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (AlterTrigRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
void setError(const DropTrigRef* ref) {
|
||||
if (ref != 0 && ! hasError()) {
|
||||
m_errorCode = (AlterTrigRef::ErrorCode)ref->getErrorCode();
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
m_lastError = AlterTrigRef::NoError;
|
||||
if (ref != 0) {
|
||||
m_lastError = (AlterTrigRef::ErrorCode)ref->getErrorCode();
|
||||
if (! hasError()) {
|
||||
m_errorCode = m_lastError;
|
||||
m_errorLine = ref->getErrorLine();
|
||||
m_errorNode = ref->getErrorNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -11043,6 +11043,7 @@ void Dbtc::execCREATE_TRIG_REQ(Signal* signal)
|
|||
if (ERROR_INSERTED(8033) ||
|
||||
!c_theDefinedTriggers.seizeId(triggerPtr,
|
||||
createTrigReq->getTriggerId())) {
|
||||
jam();
|
||||
CLEAR_ERROR_INSERT_VALUE;
|
||||
// Failed to allocate trigger record
|
||||
CreateTrigRef * const createTrigRef =
|
||||
|
@ -11077,8 +11078,10 @@ void Dbtc::execDROP_TRIG_REQ(Signal* signal)
|
|||
DropTrigReq * const dropTrigReq = (DropTrigReq *)&signal->theData[0];
|
||||
BlockReference sender = signal->senderBlockRef();
|
||||
|
||||
if ((c_theDefinedTriggers.getPtr(dropTrigReq->getTriggerId())) == NULL) {
|
||||
if (ERROR_INSERTED(8035) ||
|
||||
(c_theDefinedTriggers.getPtr(dropTrigReq->getTriggerId())) == NULL) {
|
||||
jam();
|
||||
CLEAR_ERROR_INSERT_VALUE;
|
||||
// Failed to find find trigger record
|
||||
DropTrigRef * const dropTrigRef = (DropTrigRef *)&signal->theData[0];
|
||||
|
||||
|
@ -11110,6 +11113,7 @@ void Dbtc::execCREATE_INDX_REQ(Signal* signal)
|
|||
|
||||
if (ERROR_INSERTED(8034) ||
|
||||
!c_theIndexes.seizeId(indexPtr, createIndxReq->getIndexId())) {
|
||||
jam();
|
||||
CLEAR_ERROR_INSERT_VALUE;
|
||||
// Failed to allocate index record
|
||||
CreateIndxRef * const createIndxRef =
|
||||
|
@ -11322,8 +11326,10 @@ void Dbtc::execDROP_INDX_REQ(Signal* signal)
|
|||
TcIndexData* indexData;
|
||||
BlockReference sender = signal->senderBlockRef();
|
||||
|
||||
if ((indexData = c_theIndexes.getPtr(dropIndxReq->getIndexId())) == NULL) {
|
||||
if (ERROR_INSERTED(8036) ||
|
||||
(indexData = c_theIndexes.getPtr(dropIndxReq->getIndexId())) == NULL) {
|
||||
jam();
|
||||
CLEAR_ERROR_INSERT_VALUE;
|
||||
// Failed to find index record
|
||||
DropIndxRef * const dropIndxRef =
|
||||
(DropIndxRef *)signal->getDataPtrSend();
|
||||
|
|
|
@ -305,6 +305,10 @@ Dbtup::primaryKey(Tablerec* const regTabPtr, Uint32 attrId)
|
|||
Uint32
|
||||
Dbtup::dropTrigger(Tablerec* table, const DropTrigReq* req)
|
||||
{
|
||||
if (ERROR_INSERTED(4004)) {
|
||||
CLEAR_ERROR_INSERT_VALUE;
|
||||
return 9999;
|
||||
}
|
||||
Uint32 triggerId = req->getTriggerId();
|
||||
|
||||
TriggerType::Value ttype = req->getTriggerType();
|
||||
|
|
|
@ -18,8 +18,7 @@ libkernel_a_SOURCES = \
|
|||
SimplePropertiesSection.cpp \
|
||||
SectionReader.cpp \
|
||||
MetaData.cpp \
|
||||
Mutex.cpp SafeCounter.cpp \
|
||||
SuperPool.cpp
|
||||
Mutex.cpp SafeCounter.cpp
|
||||
|
||||
INCLUDES_LOC = -I$(top_srcdir)/storage/ndb/src/mgmapi
|
||||
|
||||
|
|
|
@ -401,9 +401,14 @@ static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
|
|||
uint res_length, char *min_str,char *max_str,
|
||||
uint *min_length,uint *max_length)
|
||||
{
|
||||
const char *end=ptr+ptr_length;
|
||||
const char *end;
|
||||
char *min_org=min_str;
|
||||
char *min_end=min_str+res_length;
|
||||
uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
|
||||
|
||||
if (charlen < ptr_length)
|
||||
ptr_length= charlen;
|
||||
end= ptr + ptr_length;
|
||||
|
||||
for (; ptr != end && min_str != min_end ; ptr++)
|
||||
{
|
||||
|
|
|
@ -2714,9 +2714,14 @@ static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
|
|||
uint res_length, char *min_str,char *max_str,
|
||||
uint *min_length,uint *max_length)
|
||||
{
|
||||
const char *end=ptr+ptr_length;
|
||||
const char *end;
|
||||
char *min_org=min_str;
|
||||
char *min_end=min_str+res_length;
|
||||
uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
|
||||
|
||||
if (charlen < ptr_length)
|
||||
ptr_length= charlen;
|
||||
end= ptr + ptr_length;
|
||||
|
||||
for (; ptr != end && min_str != min_end ; ptr++)
|
||||
{
|
||||
|
|
|
@ -1034,9 +1034,15 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
|
|||
char *min_str,char *max_str,
|
||||
uint *min_length,uint *max_length)
|
||||
{
|
||||
const char *end=ptr+ptr_length;
|
||||
const char *end;
|
||||
char *min_org=min_str;
|
||||
char *min_end=min_str+res_length;
|
||||
#ifdef USE_MB
|
||||
uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
|
||||
if (charlen < ptr_length)
|
||||
ptr_length= charlen;
|
||||
#endif
|
||||
end= ptr + ptr_length;
|
||||
|
||||
for (; ptr != end && min_str != min_end ; ptr++)
|
||||
{
|
||||
|
|
|
@ -330,9 +330,14 @@ static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)),
|
|||
uint res_length, char *min_str,char *max_str,
|
||||
uint *min_length,uint *max_length)
|
||||
{
|
||||
const char *end=ptr+ptr_length;
|
||||
const char *end;
|
||||
char *min_org=min_str;
|
||||
char *min_end=min_str+res_length;
|
||||
uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen);
|
||||
|
||||
if (charlen < ptr_length)
|
||||
ptr_length= charlen;
|
||||
end= ptr + ptr_length;
|
||||
|
||||
while (ptr < end && min_str < min_end) {
|
||||
if (ismbchar_sjis(cs, ptr, end)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue