Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
362a45fd
Commit
362a45fd
authored
Jun 14, 2005
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/export/space/pekka/ndb/version/my41
parents
b5eddef1
14da13ea
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
194 additions
and
27 deletions
+194
-27
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+2
-0
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+34
-0
mysql-test/r/func_if.result
mysql-test/r/func_if.result
+13
-0
mysql-test/t/ctype_utf8.test
mysql-test/t/ctype_utf8.test
+42
-0
mysql-test/t/func_if.test
mysql-test/t/func_if.test
+12
-0
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+10
-6
ndb/test/ndbapi/testTimeout.cpp
ndb/test/ndbapi/testTimeout.cpp
+74
-12
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+1
-3
sql/sql_select.cc
sql/sql_select.cc
+6
-6
No files found.
BitKeeper/etc/logging_ok
View file @
362a45fd
...
...
@@ -80,6 +80,7 @@ hf@deer.mysql.r18.ru
hf@genie.(none)
holyfoot@mysql.com
igor@hundin.mysql.fi
igor@igor-inspiron.creware.com
igor@linux.local
igor@rurik.mysql.com
ingo@mysql.com
...
...
@@ -176,6 +177,7 @@ mysqldev@melody.local
mysqldev@mysql.com
mysqldev@o2k.irixworld.net
ndbdev@dl145b.mysql.com
ndbdev@dl145c.mysql.com
ndbdev@eel.hemma.oreland.se
ndbdev@ndbmaster.mysql.com
nick@mysql.com
...
...
mysql-test/r/ctype_utf8.result
View file @
362a45fd
...
...
@@ -905,3 +905,37 @@ select * from t1 where city = 'Durban ';
id city
2 Durban
drop table t1;
SET NAMES UTF8;
CREATE TABLE t1 (
`id` int(20) NOT NULL auto_increment,
`country` varchar(100) NOT NULL default '',
`shortcode` varchar(100) NOT NULL default '',
`operator` varchar(100) NOT NULL default '',
`momid` varchar(30) NOT NULL default '',
`keyword` varchar(160) NOT NULL default '',
`content` varchar(160) NOT NULL default '',
`second_token` varchar(160) default NULL,
`gateway_id` int(11) NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
`msisdn` varchar(15) NOT NULL default '',
PRIMARY KEY (`id`),
UNIQUE KEY `MSCCSPK_20030521130957121` (`momid`),
KEY `IX_mobile_originated_message_keyword` (`keyword`),
KEY `IX_mobile_originated_message_created` (`created`),
KEY `IX_mobile_originated_message_support` (`msisdn`,`momid`,`keyword`,`gateway_id`,`created`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES
(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01 17:30:43','1234567890'),
(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02 22:43:10','1234567890');
CREATE TABLE t2 (
`msisdn` varchar(15) NOT NULL default '',
`operator_id` int(11) NOT NULL default '0',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
UNIQUE KEY `PK_user` (`msisdn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
content msisdn
ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми 1234567890
11 g 1234567890
DROP TABLE t1,t2;
mysql-test/r/func_if.result
View file @
362a45fd
...
...
@@ -86,3 +86,16 @@ drop table t1;
SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL;
NULLIF(5,5) IS NULL NULLIF(5,5) IS NOT NULL
1 0
CREATE TABLE t1 (a CHAR(10));
INSERT INTO t1 VALUES ('aaa'), (NULL), (''), ('bbb');
SELECT a, NULLIF(a,'') FROM t1;
a NULLIF(a,'')
aaa aaa
NULL NULL
NULL
bbb bbb
SELECT a, NULLIF(a,'') FROM t1 WHERE NULLIF(a,'') IS NULL;
a NULLIF(a,'')
NULL NULL
NULL
DROP TABLE t1;
mysql-test/t/ctype_utf8.test
View file @
362a45fd
...
...
@@ -746,3 +746,45 @@ insert into t1 values (2,'Durban');
select
*
from
t1
where
city
=
'Durban'
;
select
*
from
t1
where
city
=
'Durban '
;
drop
table
t1
;
#
# Test for bug #11167: join for utf8 varchar value longer than 255 bytes
#
SET
NAMES
UTF8
;
CREATE
TABLE
t1
(
`id`
int
(
20
)
NOT
NULL
auto_increment
,
`country`
varchar
(
100
)
NOT
NULL
default
''
,
`shortcode`
varchar
(
100
)
NOT
NULL
default
''
,
`operator`
varchar
(
100
)
NOT
NULL
default
''
,
`momid`
varchar
(
30
)
NOT
NULL
default
''
,
`keyword`
varchar
(
160
)
NOT
NULL
default
''
,
`content`
varchar
(
160
)
NOT
NULL
default
''
,
`second_token`
varchar
(
160
)
default
NULL
,
`gateway_id`
int
(
11
)
NOT
NULL
default
'0'
,
`created`
datetime
NOT
NULL
default
'0000-00-00 00:00:00'
,
`msisdn`
varchar
(
15
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`MSCCSPK_20030521130957121`
(
`momid`
),
KEY
`IX_mobile_originated_message_keyword`
(
`keyword`
),
KEY
`IX_mobile_originated_message_created`
(
`created`
),
KEY
`IX_mobile_originated_message_support`
(
`msisdn`
,
`momid`
,
`keyword`
,
`gateway_id`
,
`created`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
;
INSERT
INTO
t1
VALUES
(
1
,
'blah'
,
'464'
,
'aaa'
,
'fkc1c9ilc20x0hgae7lx6j09'
,
'ERR'
,
'ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми'
,
'ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР'
,
3
,
'2005-06-01 17:30:43'
,
'1234567890'
),
(
2
,
'blah'
,
'464'
,
'aaa'
,
'haxpl2ilc20x00bj4tt2m5ti'
,
'11'
,
'11 g'
,
'G'
,
3
,
'2005-06-02 22:43:10'
,
'1234567890'
);
CREATE
TABLE
t2
(
`msisdn`
varchar
(
15
)
NOT
NULL
default
''
,
`operator_id`
int
(
11
)
NOT
NULL
default
'0'
,
`created`
datetime
NOT
NULL
default
'0000-00-00 00:00:00'
,
UNIQUE
KEY
`PK_user`
(
`msisdn`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
INSERT
INTO
t2
VALUES
(
'1234567890'
,
2
,
'2005-05-24 13:53:25'
);
SELECT
content
,
t2
.
msisdn
FROM
t1
,
t2
WHERE
t1
.
msisdn
=
'1234567890'
;
DROP
TABLE
t1
,
t2
;
mysql-test/t/func_if.test
View file @
362a45fd
...
...
@@ -60,3 +60,15 @@ drop table t1;
# Bug #5595 NULLIF() IS NULL returns false if NULLIF() returns NULL
#
SELECT
NULLIF
(
5
,
5
)
IS
NULL
,
NULLIF
(
5
,
5
)
IS
NOT
NULL
;
#
# Test for bug #11142: evaluation of NULLIF when the first argument is NULL
#
CREATE
TABLE
t1
(
a
CHAR
(
10
));
INSERT
INTO
t1
VALUES
(
'aaa'
),
(
NULL
),
(
''
),
(
'bbb'
);
SELECT
a
,
NULLIF
(
a
,
''
)
FROM
t1
;
SELECT
a
,
NULLIF
(
a
,
''
)
FROM
t1
WHERE
NULLIF
(
a
,
''
)
IS
NULL
;
DROP
TABLE
t1
;
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
View file @
362a45fd
...
...
@@ -722,11 +722,14 @@ Dbtc::set_timeout_value(Uint32 timeOut)
void
Dbtc
::
set_appl_timeout_value
(
Uint32
timeOut
)
{
timeOut
/=
10
;
if
(
timeOut
<
ctimeOutValue
)
{
jam
();
c_appl_timeout_value
=
ctimeOutValue
;
}
//if
if
(
timeOut
)
{
timeOut
/=
10
;
if
(
timeOut
<
ctimeOutValue
)
{
jam
();
c_appl_timeout_value
=
ctimeOutValue
;
}
//if
}
c_appl_timeout_value
=
timeOut
;
}
...
...
@@ -6133,7 +6136,8 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
particular state we will use the application timeout parameter rather
than the shorter Deadlock detection timeout.
*/
if
((
ctcTimer
-
getApiConTimer
(
apiConnectptr
.
i
))
<=
c_appl_timeout_value
)
{
if
(
c_appl_timeout_value
==
0
||
(
ctcTimer
-
getApiConTimer
(
apiConnectptr
.
i
))
<=
c_appl_timeout_value
)
{
jam
();
return
;
}
//if
...
...
ndb/test/ndbapi/testTimeout.cpp
View file @
362a45fd
...
...
@@ -22,14 +22,14 @@
#include <NdbConfig.hpp>
#include <signaldata/DumpStateOrd.hpp>
#define TIMEOUT 3000
#define TIMEOUT (Uint32)3000
Uint32
g_org_timeout
=
3000
;
int
setTransactionTimeout
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
NdbRestarter
restarter
;
int
timeout
=
ctx
->
getProperty
(
"TransactionInactiveTimeout"
,
TIMEOUT
);
NdbConfig
conf
(
GETNDB
(
step
)
->
getNodeId
()
+
1
);
unsigned
int
nodeId
=
conf
.
getMasterNodeId
();
if
(
!
conf
.
getProperty
(
nodeId
,
...
...
@@ -39,7 +39,7 @@ setTransactionTimeout(NDBT_Context* ctx, NDBT_Step* step){
return
NDBT_FAILED
;
}
int
val
[]
=
{
DumpStateOrd
::
TcSetApplTransactionTimeout
,
TIMEOUT
};
int
val
[]
=
{
DumpStateOrd
::
TcSetApplTransactionTimeout
,
timeout
};
if
(
restarter
.
dumpStateAllNodes
(
val
,
2
)
!=
0
){
return
NDBT_FAILED
;
}
...
...
@@ -94,9 +94,11 @@ int runTimeoutTrans(NDBT_Context* ctx, NDBT_Step* step){
unsigned
int
nodeId
=
conf
.
getMasterNodeId
();
int
stepNo
=
step
->
getStepNo
();
int
minSleep
=
(
int
)(
TIMEOUT
*
1.5
);
int
maxSleep
=
TIMEOUT
*
2
;
ndbout
<<
"TransactionInactiveTimeout="
<<
TIMEOUT
int
timeout
=
ctx
->
getProperty
(
"TransactionInactiveTimeout"
,
TIMEOUT
);
int
minSleep
=
(
int
)(
timeout
*
1.5
);
int
maxSleep
=
timeout
*
2
;
ndbout
<<
"TransactionInactiveTimeout="
<<
timeout
<<
", minSleep="
<<
minSleep
<<
", maxSleep="
<<
maxSleep
<<
endl
;
...
...
@@ -134,8 +136,10 @@ int runTimeoutTrans2(NDBT_Context* ctx, NDBT_Step* step){
int
mul2
=
ctx
->
getProperty
(
"Op2"
,
(
Uint32
)
0
);
int
records
=
ctx
->
getNumRecords
();
int
minSleep
=
(
int
)(
TIMEOUT
*
1.5
);
int
maxSleep
=
TIMEOUT
*
2
;
int
timeout
=
ctx
->
getProperty
(
"TransactionInactiveTimeout"
,
TIMEOUT
);
int
minSleep
=
(
int
)(
timeout
*
1.5
);
int
maxSleep
=
timeout
*
2
;
HugoOperations
hugoOps
(
*
ctx
->
getTab
());
Ndb
*
pNdb
=
GETNDB
(
step
);
...
...
@@ -148,7 +152,7 @@ int runTimeoutTrans2(NDBT_Context* ctx, NDBT_Step* step){
op1
=
(
op1
%
5
);
op2
=
(
op2
%
5
);
ndbout
<<
stepNo
<<
": TransactionInactiveTimeout="
<<
TIMEOUT
ndbout
<<
stepNo
<<
": TransactionInactiveTimeout="
<<
timeout
<<
", minSleep="
<<
minSleep
<<
", maxSleep="
<<
maxSleep
<<
", op1="
<<
op1
...
...
@@ -250,8 +254,10 @@ int runDontTimeoutTrans(NDBT_Context* ctx, NDBT_Step* step){
int
loops
=
ctx
->
getNumLoops
();
int
stepNo
=
step
->
getStepNo
();
int
maxSleep
=
(
int
)(
TIMEOUT
*
0.5
);
ndbout
<<
"TransactionInactiveTimeout="
<<
TIMEOUT
int
timeout
=
ctx
->
getProperty
(
"TransactionInactiveTimeout"
,
TIMEOUT
);
int
maxSleep
=
(
int
)(
timeout
*
0.5
);
ndbout
<<
"TransactionInactiveTimeout="
<<
timeout
<<
", maxSleep="
<<
maxSleep
<<
endl
;
...
...
@@ -281,6 +287,51 @@ int runDontTimeoutTrans(NDBT_Context* ctx, NDBT_Step* step){
return
result
;
}
int
runDeadlockTimeoutTrans
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
int
loops
=
ctx
->
getNumLoops
();
int
stepNo
=
step
->
getStepNo
();
Uint32
deadlock_timeout
;
NdbConfig
conf
(
GETNDB
(
step
)
->
getNodeId
()
+
1
);
unsigned
int
nodeId
=
conf
.
getMasterNodeId
();
if
(
!
conf
.
getProperty
(
nodeId
,
NODE_TYPE_DB
,
CFG_DB_TRANSACTION_DEADLOCK_TIMEOUT
,
&
deadlock_timeout
)){
return
NDBT_FAILED
;
}
int
do_sleep
=
(
int
)(
deadlock_timeout
*
0.5
);
HugoOperations
hugoOps
(
*
ctx
->
getTab
());
Ndb
*
pNdb
=
GETNDB
(
step
);
for
(
int
l
=
0
;
l
<
loops
&&
result
==
NDBT_OK
;
l
++
){
do
{
// Commit transaction
CHECK
(
hugoOps
.
startTransaction
(
pNdb
)
==
0
);
CHECK
(
hugoOps
.
pkReadRecord
(
pNdb
,
stepNo
)
==
0
);
CHECK
(
hugoOps
.
execute_NoCommit
(
pNdb
)
==
0
);
int
sleep
=
deadlock_timeout
*
1.5
+
myRandom48
(
do_sleep
);
ndbout
<<
"Sleeping for "
<<
sleep
<<
" milliseconds"
<<
endl
;
NdbSleep_MilliSleep
(
sleep
);
// Expect that transaction has NOT timed-out
CHECK
(
hugoOps
.
execute_Commit
(
pNdb
)
==
0
);
}
while
(
false
);
hugoOps
.
closeTransaction
(
pNdb
);
}
return
result
;
}
int
runBuddyTransNoTimeout
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
int
loops
=
ctx
->
getNumLoops
();
...
...
@@ -334,6 +385,17 @@ TESTCASE("DontTimeoutTransaction",
FINALIZER
(
resetTransactionTimeout
);
FINALIZER
(
runClearTable
);
}
TESTCASE
(
"Bug11290"
,
"Setting TransactionInactiveTimeout to 0(zero) "
\
"should result in infinite timeout, and not as "
\
"was the bug, a timeout that is equal to the deadlock timeout"
){
TC_PROPERTY
(
"TransactionInactiveTimeout"
,(
Uint32
)
0
);
INITIALIZER
(
runLoadTable
);
INITIALIZER
(
setTransactionTimeout
);
STEPS
(
runDeadlockTimeoutTrans
,
1
);
FINALIZER
(
resetTransactionTimeout
);
FINALIZER
(
runClearTable
);
}
TESTCASE
(
"DontTimeoutTransaction5"
,
"Test that the transaction does not timeout "
\
"if we sleep during the transaction. Use a sleep "
\
...
...
sql/item_cmpfunc.cc
View file @
362a45fd
...
...
@@ -1161,9 +1161,7 @@ Item_func_nullif::val_str(String *str)
bool
Item_func_nullif
::
is_null
()
{
if
(
!
cmp
.
compare
())
return
(
null_value
=
1
);
return
0
;
return
(
null_value
=
(
!
cmp
.
compare
()
?
1
:
args
[
0
]
->
null_value
));
}
/*
...
...
sql/sql_select.cc
View file @
362a45fd
...
...
@@ -8112,9 +8112,9 @@ store_record_in_cache(JOIN_CACHE *cache)
end
>
str
&&
end
[
-
1
]
==
' '
;
end
--
)
;
length
=
(
uint
)
(
end
-
str
);
memcpy
(
pos
+
1
,
str
,
length
);
*
pos
=
(
uchar
)
length
;
pos
+=
length
+
1
;
memcpy
(
pos
+
sizeof
(
uint
),
str
,
length
);
*
((
uint
*
)
pos
)
=
length
;
pos
+=
length
+
sizeof
(
uint
)
;
}
else
{
...
...
@@ -8177,9 +8177,9 @@ read_cached_record(JOIN_TAB *tab)
{
if
(
copy
->
strip
)
{
memcpy
(
copy
->
str
,
pos
+
1
,
length
=
(
uint
)
*
pos
);
memset
(
copy
->
str
+
length
,
' '
,
copy
->
length
-
length
);
pos
+=
1
+
length
;
memcpy
(
copy
->
str
,
pos
+
sizeof
(
uint
),
length
=
*
((
uint
*
)
pos
)
);
memset
(
copy
->
str
+
length
,
' '
,
copy
->
length
-
length
);
pos
+=
sizeof
(
uint
)
+
length
;
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment