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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
0792cd92
Commit
0792cd92
authored
May 22, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
parents
321708d3
a1ff1c97
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
459 additions
and
255 deletions
+459
-255
mysql-test/r/func_group.result
mysql-test/r/func_group.result
+0
-138
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+138
-0
mysql-test/r/ndb_blob.result
mysql-test/r/ndb_blob.result
+66
-0
mysql-test/t/func_group.test
mysql-test/t/func_group.test
+0
-71
mysql-test/t/init_connect.test
mysql-test/t/init_connect.test
+2
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+72
-0
mysql-test/t/ndb_blob.test
mysql-test/t/ndb_blob.test
+56
-0
ndb/include/util/SocketServer.hpp
ndb/include/util/SocketServer.hpp
+5
-3
ndb/src/common/util/SocketServer.cpp
ndb/src/common/util/SocketServer.cpp
+35
-9
ndb/src/common/util/socket_io.cpp
ndb/src/common/util/socket_io.cpp
+39
-31
ndb/src/kernel/vm/Configuration.cpp
ndb/src/kernel/vm/Configuration.cpp
+5
-3
ndb/src/mgmsrv/Services.cpp
ndb/src/mgmsrv/Services.cpp
+2
-0
ndb/src/ndbapi/NdbDictionaryImpl.hpp
ndb/src/ndbapi/NdbDictionaryImpl.hpp
+25
-0
ndb/src/ndbapi/NdbOperationSearch.cpp
ndb/src/ndbapi/NdbOperationSearch.cpp
+14
-0
No files found.
mysql-test/r/func_group.result
View file @
0792cd92
...
...
@@ -821,144 +821,6 @@ SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6;
MAX(id)
NULL
DROP TABLE t1;
create table t1m (a int) engine=myisam;
create table t1i (a int) engine=innodb;
create table t2m (a int) engine=myisam;
create table t2i (a int) engine=innodb;
insert into t2m values (5);
insert into t2i values (5);
select min(a) from t1m;
min(a)
NULL
select min(7) from t1m;
min(7)
NULL
select min(7) from DUAL;
min(7)
NULL
explain select min(7) from t2m join t1m;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select min(7) from t2m join t1m;
min(7)
NULL
select max(a) from t1m;
max(a)
NULL
select max(7) from t1m;
max(7)
NULL
select max(7) from DUAL;
max(7)
NULL
explain select max(7) from t2m join t1m;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(7) from t2m join t1m;
max(7)
NULL
select 1, min(a) from t1m where a=99;
1 min(a)
1 NULL
select 1, min(a) from t1m where 1=99;
1 min(a)
1 NULL
select 1, min(1) from t1m where a=99;
1 min(1)
1 NULL
select 1, min(1) from t1m where 1=99;
1 min(1)
1 NULL
select 1, max(a) from t1m where a=99;
1 max(a)
1 NULL
select 1, max(a) from t1m where 1=99;
1 max(a)
1 NULL
select 1, max(1) from t1m where a=99;
1 max(1)
1 NULL
select 1, max(1) from t1m where 1=99;
1 max(1)
1 NULL
select min(a) from t1i;
min(a)
NULL
select min(7) from t1i;
min(7)
NULL
select min(7) from DUAL;
min(7)
NULL
explain select min(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select min(7) from t2i join t1i;
min(7)
NULL
select max(a) from t1i;
max(a)
NULL
select max(7) from t1i;
max(7)
NULL
select max(7) from DUAL;
max(7)
NULL
explain select max(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select max(7) from t2i join t1i;
max(7)
NULL
select 1, min(a) from t1i where a=99;
1 min(a)
1 NULL
select 1, min(a) from t1i where 1=99;
1 min(a)
1 NULL
select 1, min(1) from t1i where a=99;
1 min(1)
1 NULL
select 1, min(1) from t1i where 1=99;
1 min(1)
1 NULL
select 1, max(a) from t1i where a=99;
1 max(a)
1 NULL
select 1, max(a) from t1i where 1=99;
1 max(a)
1 NULL
select 1, max(1) from t1i where a=99;
1 max(1)
1 NULL
select 1, max(1) from t1i where 1=99;
1 max(1)
1 NULL
explain select count(*), min(7), max(7) from t1m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t1i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t1m, t2i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t2i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t2m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2m system NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t2m, t1i;
count(*) min(7) max(7)
0 NULL NULL
drop table t1m, t1i, t2m, t2i;
create table t2 (ff double);
insert into t2 values (2.2);
select cast(sum(distinct ff) as decimal(5,2)) from t2;
...
...
mysql-test/r/innodb_mysql.result
View file @
0792cd92
...
...
@@ -54,3 +54,141 @@ c.c_id = 218 and expiredate is null;
slai_id
12
drop table t1, t2;
create table t1m (a int) engine=myisam;
create table t1i (a int) engine=innodb;
create table t2m (a int) engine=myisam;
create table t2i (a int) engine=innodb;
insert into t2m values (5);
insert into t2i values (5);
select min(a) from t1m;
min(a)
NULL
select min(7) from t1m;
min(7)
NULL
select min(7) from DUAL;
min(7)
NULL
explain select min(7) from t2m join t1m;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select min(7) from t2m join t1m;
min(7)
NULL
select max(a) from t1m;
max(a)
NULL
select max(7) from t1m;
max(7)
NULL
select max(7) from DUAL;
max(7)
NULL
explain select max(7) from t2m join t1m;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(7) from t2m join t1m;
max(7)
NULL
select 1, min(a) from t1m where a=99;
1 min(a)
1 NULL
select 1, min(a) from t1m where 1=99;
1 min(a)
1 NULL
select 1, min(1) from t1m where a=99;
1 min(1)
1 NULL
select 1, min(1) from t1m where 1=99;
1 min(1)
1 NULL
select 1, max(a) from t1m where a=99;
1 max(a)
1 NULL
select 1, max(a) from t1m where 1=99;
1 max(a)
1 NULL
select 1, max(1) from t1m where a=99;
1 max(1)
1 NULL
select 1, max(1) from t1m where 1=99;
1 max(1)
1 NULL
select min(a) from t1i;
min(a)
NULL
select min(7) from t1i;
min(7)
NULL
select min(7) from DUAL;
min(7)
NULL
explain select min(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select min(7) from t2i join t1i;
min(7)
NULL
select max(a) from t1i;
max(a)
NULL
select max(7) from t1i;
max(7)
NULL
select max(7) from DUAL;
max(7)
NULL
explain select max(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select max(7) from t2i join t1i;
max(7)
NULL
select 1, min(a) from t1i where a=99;
1 min(a)
1 NULL
select 1, min(a) from t1i where 1=99;
1 min(a)
1 NULL
select 1, min(1) from t1i where a=99;
1 min(1)
1 NULL
select 1, min(1) from t1i where 1=99;
1 min(1)
1 NULL
select 1, max(a) from t1i where a=99;
1 max(a)
1 NULL
select 1, max(a) from t1i where 1=99;
1 max(a)
1 NULL
select 1, max(1) from t1i where a=99;
1 max(1)
1 NULL
select 1, max(1) from t1i where 1=99;
1 max(1)
1 NULL
explain select count(*), min(7), max(7) from t1m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t1i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t1m, t2i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t2i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t2i;
count(*) min(7) max(7)
0 NULL NULL
explain select count(*), min(7), max(7) from t2m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2m system NULL NULL NULL NULL 1
1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t2m, t1i;
count(*) min(7) max(7)
0 NULL NULL
drop table t1m, t1i, t2m, t2i;
mysql-test/r/ndb_blob.result
View file @
0792cd92
...
...
@@ -500,3 +500,69 @@ select count(*) from t1;
count(*)
0
drop table t1;
create table t1 (
a varchar(40) not null,
b mediumint not null,
t text,
c varchar(2) not null,
d bigint not null,
primary key (a,b,c),
key (c,a),
unique key (d)
) engine=ndb;
insert into t1 (a,b,c,d,t) values ('a',1110,'a',1,@v1);
insert into t1 (a,b,c,d,t) values ('b',1110,'a',2,@v2);
insert into t1 (a,b,c,d,t) values ('a',1110,'b',3,@v3);
insert into t1 (a,b,c,d,t) values ('b',1110,'b',4,@v4);
select a,b,c,d,sha1(t) from t1 order by c,a;
a b c d sha1(t)
a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
b 1110 a 2 b238654911689bfb626a3ef9dba4a1ca074e6a5e
a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
b 1110 b 4 NULL
select a,b,c,d,sha1(t) from t1 where a='a' and b=1110 and c='a';
a b c d sha1(t)
a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
select a,b,c,d,sha1(t) from t1 where a='a' and b=1110 and c='b';
a b c d sha1(t)
a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
update t1 set t=@v4 where a='b' and b=1110 and c='a';
update t1 set t=@v2 where a='b' and b=1110 and c='b';
select a,b,c,d,sha1(t) from t1 order by c,a;
a b c d sha1(t)
a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
b 1110 a 2 NULL
a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
b 1110 b 4 b238654911689bfb626a3ef9dba4a1ca074e6a5e
update t1 set t=@v2 where d=2;
update t1 set t=@v4 where d=4;
select a,b,c,d,sha1(t) from t1 order by c,a;
a b c d sha1(t)
a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
b 1110 a 2 b238654911689bfb626a3ef9dba4a1ca074e6a5e
a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
b 1110 b 4 NULL
update t1 set t=@v4 where a='b' and c='a';
update t1 set t=@v2 where a='b' and c='b';
select a,b,c,d,sha1(t) from t1 order by c,a;
a b c d sha1(t)
a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
b 1110 a 2 NULL
a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
b 1110 b 4 b238654911689bfb626a3ef9dba4a1ca074e6a5e
update t1 set t=@v2 where b+d=1112;
update t1 set t=@v4 where b+d=1114;
select a,b,c,d,sha1(t) from t1 order by c,a;
a b c d sha1(t)
a 1110 a 1 558a30713786aa72f66abc1e6a521d55aacdeeb5
b 1110 a 2 b238654911689bfb626a3ef9dba4a1ca074e6a5e
a 1110 b 3 2b6515f29c20b8e9e17cc597527e516c0de8d612
b 1110 b 4 NULL
delete from t1 where a='a' and b=1110 and c='a';
delete from t1 where a='b' and c='a';
delete from t1 where d=3;
delete from t1 where b+d=1114;
select count(*) from t1;
count(*)
0
drop table t1;
mysql-test/t/func_group.test
View file @
0792cd92
...
...
@@ -539,77 +539,6 @@ INSERT INTO t1 VALUES
SELECT
MAX
(
id
)
FROM
t1
WHERE
id
<
3
AND
a
=
2
AND
b
=
6
;
DROP
TABLE
t1
;
#
# Bug #12882 min/max inconsistent on empty table
#
--
disable_warnings
create
table
t1m
(
a
int
)
engine
=
myisam
;
create
table
t1i
(
a
int
)
engine
=
innodb
;
create
table
t2m
(
a
int
)
engine
=
myisam
;
create
table
t2i
(
a
int
)
engine
=
innodb
;
--
enable_warnings
insert
into
t2m
values
(
5
);
insert
into
t2i
values
(
5
);
# test with MyISAM
select
min
(
a
)
from
t1m
;
select
min
(
7
)
from
t1m
;
select
min
(
7
)
from
DUAL
;
explain
select
min
(
7
)
from
t2m
join
t1m
;
select
min
(
7
)
from
t2m
join
t1m
;
select
max
(
a
)
from
t1m
;
select
max
(
7
)
from
t1m
;
select
max
(
7
)
from
DUAL
;
explain
select
max
(
7
)
from
t2m
join
t1m
;
select
max
(
7
)
from
t2m
join
t1m
;
select
1
,
min
(
a
)
from
t1m
where
a
=
99
;
select
1
,
min
(
a
)
from
t1m
where
1
=
99
;
select
1
,
min
(
1
)
from
t1m
where
a
=
99
;
select
1
,
min
(
1
)
from
t1m
where
1
=
99
;
select
1
,
max
(
a
)
from
t1m
where
a
=
99
;
select
1
,
max
(
a
)
from
t1m
where
1
=
99
;
select
1
,
max
(
1
)
from
t1m
where
a
=
99
;
select
1
,
max
(
1
)
from
t1m
where
1
=
99
;
# test with InnoDB
select
min
(
a
)
from
t1i
;
select
min
(
7
)
from
t1i
;
select
min
(
7
)
from
DUAL
;
explain
select
min
(
7
)
from
t2i
join
t1i
;
select
min
(
7
)
from
t2i
join
t1i
;
select
max
(
a
)
from
t1i
;
select
max
(
7
)
from
t1i
;
select
max
(
7
)
from
DUAL
;
explain
select
max
(
7
)
from
t2i
join
t1i
;
select
max
(
7
)
from
t2i
join
t1i
;
select
1
,
min
(
a
)
from
t1i
where
a
=
99
;
select
1
,
min
(
a
)
from
t1i
where
1
=
99
;
select
1
,
min
(
1
)
from
t1i
where
a
=
99
;
select
1
,
min
(
1
)
from
t1i
where
1
=
99
;
select
1
,
max
(
a
)
from
t1i
where
a
=
99
;
select
1
,
max
(
a
)
from
t1i
where
1
=
99
;
select
1
,
max
(
1
)
from
t1i
where
a
=
99
;
select
1
,
max
(
1
)
from
t1i
where
1
=
99
;
# mixed MyISAM/InnoDB test
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t1i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t1i
;
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t2i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t2i
;
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t2m
,
t1i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t2m
,
t1i
;
drop
table
t1m
,
t1i
,
t2m
,
t2i
;
# End of 4.1 tests
#
...
...
mysql-test/t/init_connect.test
View file @
0792cd92
...
...
@@ -2,6 +2,8 @@
# Test of init_connect variable
#
# should work with embedded server after mysqltest is fixed
--
source
include
/
not_embedded
.
inc
connect
(
con0
,
localhost
,
root
,,);
connection
con0
;
select
hex
(
@
a
);
...
...
mysql-test/t/innodb_mysql.test
View file @
0792cd92
...
...
@@ -57,3 +57,75 @@ where
c
.
c_id
=
218
and
expiredate
is
null
;
drop
table
t1
,
t2
;
#
# Bug #12882 min/max inconsistent on empty table
#
--
disable_warnings
create
table
t1m
(
a
int
)
engine
=
myisam
;
create
table
t1i
(
a
int
)
engine
=
innodb
;
create
table
t2m
(
a
int
)
engine
=
myisam
;
create
table
t2i
(
a
int
)
engine
=
innodb
;
--
enable_warnings
insert
into
t2m
values
(
5
);
insert
into
t2i
values
(
5
);
# test with MyISAM
select
min
(
a
)
from
t1m
;
select
min
(
7
)
from
t1m
;
select
min
(
7
)
from
DUAL
;
explain
select
min
(
7
)
from
t2m
join
t1m
;
select
min
(
7
)
from
t2m
join
t1m
;
select
max
(
a
)
from
t1m
;
select
max
(
7
)
from
t1m
;
select
max
(
7
)
from
DUAL
;
explain
select
max
(
7
)
from
t2m
join
t1m
;
select
max
(
7
)
from
t2m
join
t1m
;
select
1
,
min
(
a
)
from
t1m
where
a
=
99
;
select
1
,
min
(
a
)
from
t1m
where
1
=
99
;
select
1
,
min
(
1
)
from
t1m
where
a
=
99
;
select
1
,
min
(
1
)
from
t1m
where
1
=
99
;
select
1
,
max
(
a
)
from
t1m
where
a
=
99
;
select
1
,
max
(
a
)
from
t1m
where
1
=
99
;
select
1
,
max
(
1
)
from
t1m
where
a
=
99
;
select
1
,
max
(
1
)
from
t1m
where
1
=
99
;
# test with InnoDB
select
min
(
a
)
from
t1i
;
select
min
(
7
)
from
t1i
;
select
min
(
7
)
from
DUAL
;
explain
select
min
(
7
)
from
t2i
join
t1i
;
select
min
(
7
)
from
t2i
join
t1i
;
select
max
(
a
)
from
t1i
;
select
max
(
7
)
from
t1i
;
select
max
(
7
)
from
DUAL
;
explain
select
max
(
7
)
from
t2i
join
t1i
;
select
max
(
7
)
from
t2i
join
t1i
;
select
1
,
min
(
a
)
from
t1i
where
a
=
99
;
select
1
,
min
(
a
)
from
t1i
where
1
=
99
;
select
1
,
min
(
1
)
from
t1i
where
a
=
99
;
select
1
,
min
(
1
)
from
t1i
where
1
=
99
;
select
1
,
max
(
a
)
from
t1i
where
a
=
99
;
select
1
,
max
(
a
)
from
t1i
where
1
=
99
;
select
1
,
max
(
1
)
from
t1i
where
a
=
99
;
select
1
,
max
(
1
)
from
t1i
where
1
=
99
;
# mixed MyISAM/InnoDB test
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t1i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t1i
;
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t2i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t1m
,
t2i
;
explain
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t2m
,
t1i
;
select
count
(
*
),
min
(
7
),
max
(
7
)
from
t2m
,
t1i
;
drop
table
t1m
,
t1i
,
t2m
,
t2i
;
mysql-test/t/ndb_blob.test
View file @
0792cd92
...
...
@@ -428,4 +428,60 @@ truncate t1;
select
count
(
*
)
from
t1
;
drop
table
t1
;
# -- bug#19956 - var* key, complex key
create
table
t1
(
a
varchar
(
40
)
not
null
,
b
mediumint
not
null
,
t
text
,
c
varchar
(
2
)
not
null
,
d
bigint
not
null
,
primary
key
(
a
,
b
,
c
),
key
(
c
,
a
),
unique
key
(
d
)
)
engine
=
ndb
;
--
disable_query_log
set
@
s1
=
'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau'
;
set
@
s2
=
'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz'
;
set
@
s3
=
'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah'
;
set
@
v1
=
repeat
(
@
s1
,
123
);
set
@
v2
=
repeat
(
@
s2
,
234
);
set
@
v3
=
repeat
(
@
s3
,
345
);
set
@
v4
=
NULL
;
--
enable_query_log
insert
into
t1
(
a
,
b
,
c
,
d
,
t
)
values
(
'a'
,
1110
,
'a'
,
1
,
@
v1
);
insert
into
t1
(
a
,
b
,
c
,
d
,
t
)
values
(
'b'
,
1110
,
'a'
,
2
,
@
v2
);
insert
into
t1
(
a
,
b
,
c
,
d
,
t
)
values
(
'a'
,
1110
,
'b'
,
3
,
@
v3
);
insert
into
t1
(
a
,
b
,
c
,
d
,
t
)
values
(
'b'
,
1110
,
'b'
,
4
,
@
v4
);
select
a
,
b
,
c
,
d
,
sha1
(
t
)
from
t1
order
by
c
,
a
;
select
a
,
b
,
c
,
d
,
sha1
(
t
)
from
t1
where
a
=
'a'
and
b
=
1110
and
c
=
'a'
;
select
a
,
b
,
c
,
d
,
sha1
(
t
)
from
t1
where
a
=
'a'
and
b
=
1110
and
c
=
'b'
;
update
t1
set
t
=@
v4
where
a
=
'b'
and
b
=
1110
and
c
=
'a'
;
update
t1
set
t
=@
v2
where
a
=
'b'
and
b
=
1110
and
c
=
'b'
;
select
a
,
b
,
c
,
d
,
sha1
(
t
)
from
t1
order
by
c
,
a
;
update
t1
set
t
=@
v2
where
d
=
2
;
update
t1
set
t
=@
v4
where
d
=
4
;
select
a
,
b
,
c
,
d
,
sha1
(
t
)
from
t1
order
by
c
,
a
;
update
t1
set
t
=@
v4
where
a
=
'b'
and
c
=
'a'
;
update
t1
set
t
=@
v2
where
a
=
'b'
and
c
=
'b'
;
select
a
,
b
,
c
,
d
,
sha1
(
t
)
from
t1
order
by
c
,
a
;
update
t1
set
t
=@
v2
where
b
+
d
=
1112
;
update
t1
set
t
=@
v4
where
b
+
d
=
1114
;
select
a
,
b
,
c
,
d
,
sha1
(
t
)
from
t1
order
by
c
,
a
;
delete
from
t1
where
a
=
'a'
and
b
=
1110
and
c
=
'a'
;
delete
from
t1
where
a
=
'b'
and
c
=
'a'
;
delete
from
t1
where
d
=
3
;
delete
from
t1
where
b
+
d
=
1114
;
select
count
(
*
)
from
t1
;
drop
table
t1
;
# End of 4.1 tests
ndb/include/util/SocketServer.hpp
View file @
0792cd92
...
...
@@ -105,7 +105,8 @@ public:
void
stopSessions
(
bool
wait
=
false
);
void
foreachSession
(
void
(
*
f
)(
Session
*
,
void
*
),
void
*
data
);
void
checkSessions
();
private:
struct
SessionInstance
{
Service
*
m_service
;
...
...
@@ -116,12 +117,13 @@ private:
Service
*
m_service
;
NDB_SOCKET_TYPE
m_socket
;
};
MutexVector
<
SessionInstance
>
m_sessions
;
NdbLockable
m_session_mutex
;
Vector
<
SessionInstance
>
m_sessions
;
MutexVector
<
ServiceInstance
>
m_services
;
unsigned
m_maxSessions
;
void
doAccept
();
void
checkSessions
();
void
checkSessions
Impl
();
void
startSession
(
SessionInstance
&
);
/**
...
...
ndb/src/common/util/SocketServer.cpp
View file @
0792cd92
...
...
@@ -184,9 +184,12 @@ SocketServer::doAccept(){
SessionInstance
s
;
s
.
m_service
=
si
.
m_service
;
s
.
m_session
=
si
.
m_service
->
newSession
(
childSock
);
if
(
s
.
m_session
!=
0
){
if
(
s
.
m_session
!=
0
)
{
m_session_mutex
.
lock
();
m_sessions
.
push_back
(
s
);
startSession
(
m_sessions
.
back
());
m_session_mutex
.
unlock
();
}
continue
;
...
...
@@ -240,10 +243,13 @@ void
SocketServer
::
doRun
(){
while
(
!
m_stopThread
){
checkSessions
();
m_session_mutex
.
lock
();
checkSessionsImpl
();
if
(
m_sessions
.
size
()
<
m_maxSessions
){
m_session_mutex
.
unlock
();
doAccept
();
}
else
{
m_session_mutex
.
unlock
();
NdbSleep_MilliSleep
(
200
);
}
}
...
...
@@ -276,17 +282,30 @@ transfer(NDB_SOCKET_TYPE sock){
void
SocketServer
::
foreachSession
(
void
(
*
func
)(
SocketServer
::
Session
*
,
void
*
),
void
*
data
)
{
m_session_mutex
.
lock
();
for
(
int
i
=
m_sessions
.
size
()
-
1
;
i
>=
0
;
i
--
){
(
*
func
)(
m_sessions
[
i
].
m_session
,
data
);
}
checkSessions
();
m_session_mutex
.
unlock
();
}
void
SocketServer
::
checkSessions
(){
for
(
int
i
=
m_sessions
.
size
()
-
1
;
i
>=
0
;
i
--
){
if
(
m_sessions
[
i
].
m_session
->
m_stopped
){
if
(
m_sessions
[
i
].
m_thread
!=
0
){
SocketServer
::
checkSessions
()
{
m_session_mutex
.
lock
();
checkSessionsImpl
();
m_session_mutex
.
unlock
();
}
void
SocketServer
::
checkSessionsImpl
()
{
for
(
int
i
=
m_sessions
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
if
(
m_sessions
[
i
].
m_session
->
m_stopped
)
{
if
(
m_sessions
[
i
].
m_thread
!=
0
)
{
void
*
ret
;
NdbThread_WaitFor
(
m_sessions
[
i
].
m_thread
,
&
ret
);
NdbThread_Destroy
(
&
m_sessions
[
i
].
m_thread
);
...
...
@@ -301,19 +320,26 @@ SocketServer::checkSessions(){
void
SocketServer
::
stopSessions
(
bool
wait
){
int
i
;
m_session_mutex
.
lock
();
for
(
i
=
m_sessions
.
size
()
-
1
;
i
>=
0
;
i
--
)
{
m_sessions
[
i
].
m_session
->
stopSession
();
m_sessions
[
i
].
m_session
->
m_stop
=
true
;
// to make sure
}
m_session_mutex
.
unlock
();
for
(
i
=
m_services
.
size
()
-
1
;
i
>=
0
;
i
--
)
m_services
[
i
].
m_service
->
stopSessions
();
if
(
wait
){
m_session_mutex
.
lock
();
while
(
m_sessions
.
size
()
>
0
){
checkSessions
();
checkSessionsImpl
();
m_session_mutex
.
unlock
();
NdbSleep_MilliSleep
(
100
);
m_session_mutex
.
lock
();
}
m_session_mutex
.
unlock
();
}
}
...
...
@@ -348,4 +374,4 @@ sessionThread_C(void* _sc){
}
template
class
MutexVector
<
SocketServer
::
ServiceInstance
>;
template
class
Mutex
Vector
<
SocketServer
::
SessionInstance
>;
template
class
Vector
<
SocketServer
::
SessionInstance
>;
ndb/src/common/util/socket_io.cpp
View file @
0792cd92
...
...
@@ -48,58 +48,66 @@ read_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
extern
"C"
int
readln_socket
(
NDB_SOCKET_TYPE
socket
,
int
timeout_millis
,
readln_socket
(
NDB_SOCKET_TYPE
socket
,
int
timeout_millis
,
char
*
buf
,
int
buflen
){
if
(
buflen
<=
1
)
return
0
;
int
sock_flags
=
fcntl
(
socket
,
F_GETFL
);
if
(
fcntl
(
socket
,
F_SETFL
,
sock_flags
|
O_NONBLOCK
)
==
-
1
)
return
-
1
;
fd_set
readset
;
FD_ZERO
(
&
readset
);
FD_SET
(
socket
,
&
readset
);
struct
timeval
timeout
;
timeout
.
tv_sec
=
(
timeout_millis
/
1000
);
timeout
.
tv_usec
=
(
timeout_millis
%
1000
)
*
1000
;
const
int
selectRes
=
select
(
socket
+
1
,
&
readset
,
0
,
0
,
&
timeout
);
if
(
selectRes
==
0
)
if
(
selectRes
==
0
)
{
return
0
;
}
if
(
selectRes
==
-
1
){
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
-
1
;
}
int
pos
=
0
;
buf
[
pos
]
=
0
;
while
(
true
){
const
int
t
=
recv
(
socket
,
&
buf
[
pos
],
1
,
0
);
if
(
t
!=
1
){
return
-
1
;
}
if
(
buf
[
pos
]
==
'\n'
){
buf
[
pos
]
=
0
;
if
(
pos
>
0
&&
buf
[
pos
-
1
]
==
'\r'
){
pos
--
;
buf
[
pos
]
=
0
;
buf
[
0
]
=
0
;
const
int
t
=
recv
(
socket
,
buf
,
buflen
,
MSG_PEEK
);
if
(
t
<
1
)
{
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
-
1
;
}
for
(
int
i
=
0
;
i
<
t
;
i
++
)
{
if
(
buf
[
i
]
==
'\n'
){
recv
(
socket
,
buf
,
i
+
1
,
0
);
buf
[
i
]
=
0
;
if
(
i
>
0
&&
buf
[
i
-
1
]
==
'\r'
){
i
--
;
buf
[
i
]
=
0
;
}
return
pos
;
}
pos
++
;
if
(
pos
==
(
buflen
-
1
)){
buf
[
pos
]
=
0
;
return
buflen
;
}
FD_ZERO
(
&
readset
);
FD_SET
(
socket
,
&
readset
);
timeout
.
tv_sec
=
(
timeout_millis
/
1000
);
timeout
.
tv_usec
=
(
timeout_millis
%
1000
)
*
1000
;
const
int
selectRes
=
select
(
socket
+
1
,
&
readset
,
0
,
0
,
&
timeout
);
if
(
selectRes
!=
1
){
return
-
1
;
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
t
;
}
}
if
(
t
==
(
buflen
-
1
)){
recv
(
socket
,
buf
,
t
,
0
);
buf
[
t
]
=
0
;
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
buflen
;
}
return
0
;
}
extern
"C"
...
...
ndb/src/kernel/vm/Configuration.cpp
View file @
0792cd92
...
...
@@ -49,7 +49,9 @@ extern EventLogger g_eventLogger;
enum
ndbd_options
{
OPT_INITIAL
=
NDB_STD_OPTIONS_LAST
,
OPT_NODAEMON
,
OPT_FOREGROUND
OPT_FOREGROUND
,
OPT_NOWAIT_NODES
,
OPT_INITIAL_START
};
NDB_STD_OPTS_VARS
;
...
...
@@ -88,11 +90,11 @@ static struct my_option my_long_options[] =
" (implies --nodaemon)"
,
(
gptr
*
)
&
_foreground
,
(
gptr
*
)
&
_foreground
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"nowait-nodes"
,
NO_ARG
,
{
"nowait-nodes"
,
OPT_NOWAIT_NODES
,
"Nodes that will not be waited for during start"
,
(
gptr
*
)
&
_nowait_nodes
,
(
gptr
*
)
&
_nowait_nodes
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"initial-start"
,
NO_ARG
,
{
"initial-start"
,
OPT_INITIAL_START
,
"Perform initial start"
,
(
gptr
*
)
&
_initialstart
,
(
gptr
*
)
&
_initialstart
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
...
ndb/src/mgmsrv/Services.cpp
View file @
0792cd92
...
...
@@ -501,6 +501,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &,
ps
.
tick
=
tick
;
m_mgmsrv
.
get_socket_server
()
->
foreachSession
(
stop_session_if_timed_out
,
&
ps
);
m_mgmsrv
.
get_socket_server
()
->
checkSessions
();
error_string
=
""
;
continue
;
}
...
...
@@ -1558,6 +1559,7 @@ MgmApiSession::purge_stale_sessions(Parser_t::Context &ctx,
ps
.
free_nodes
.
bitXORC
(
NodeBitmask
());
// invert connected_nodes to get free nodes
m_mgmsrv
.
get_socket_server
()
->
foreachSession
(
stop_session_if_not_connected
,
&
ps
);
m_mgmsrv
.
get_socket_server
()
->
checkSessions
();
m_output
->
println
(
"purge stale sessions reply"
);
if
(
str
.
length
()
>
0
)
...
...
ndb/src/ndbapi/NdbDictionaryImpl.hpp
View file @
0792cd92
...
...
@@ -91,6 +91,10 @@ public:
NdbDictionary
::
Column
*
m_facade
;
static
NdbDictionary
::
Column
*
create_psuedo
(
const
char
*
);
// Get total length in bytes, used by NdbOperation
// backported from 5.1
bool
get_var_length
(
const
void
*
value
,
Uint32
&
len
)
const
;
};
class
NdbTableImpl
:
public
NdbDictionary
::
Table
,
public
NdbDictObjectImpl
{
...
...
@@ -489,6 +493,27 @@ NdbColumnImpl::getBlobType() const {
m_type
==
NdbDictionary
::
Column
::
Text
);
}
inline
bool
NdbColumnImpl
::
get_var_length
(
const
void
*
value
,
Uint32
&
len
)
const
{
Uint32
max_len
=
m_attrSize
*
m_arraySize
;
switch
(
m_type
)
{
case
NdbDictionary
:
:
Column
::
Varchar
:
case
NdbDictionary
:
:
Column
::
Varbinary
:
len
=
1
+
*
((
Uint8
*
)
value
);
break
;
case
NdbDictionary
:
:
Column
::
Longvarchar
:
case
NdbDictionary
:
:
Column
::
Longvarbinary
:
len
=
2
+
uint2korr
((
char
*
)
value
);
break
;
default:
len
=
max_len
;
return
true
;
}
return
(
len
<=
max_len
);
}
inline
NdbTableImpl
&
NdbTableImpl
::
getImpl
(
NdbDictionary
::
Table
&
t
){
...
...
ndb/src/ndbapi/NdbOperationSearch.cpp
View file @
0792cd92
...
...
@@ -71,6 +71,7 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
Uint32
tKeyInfoPosition
;
const
char
*
aValue
=
aValuePassed
;
Uint64
tempData
[
512
];
Uint64
tempData2
[
512
];
if
((
theStatus
==
OperationDefined
)
&&
(
aValue
!=
NULL
)
&&
...
...
@@ -131,6 +132,19 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo,
OperationType
tOpType
=
theOperationType
;
Uint32
sizeInBytes
=
tAttrInfo
->
m_attrSize
*
tAttrInfo
->
m_arraySize
;
Uint32
real_len
;
if
(
!
tAttrInfo
->
get_var_length
(
aValue
,
real_len
))
{
setErrorCodeAbort
(
4209
);
DBUG_RETURN
(
-
1
);
}
// 5.0 fixed storage + NdbBlob uses full size => pad var* with nulls
if
(
real_len
<
sizeInBytes
&&
m_currentTable
->
m_noOfBlobs
!=
0
)
{
memcpy
(
tempData2
,
aValue
,
real_len
);
memset
((
char
*
)
tempData2
+
real_len
,
0
,
sizeInBytes
-
real_len
);
aValue
=
(
char
*
)
tempData2
;
}
{
/************************************************************************
* Check if the pointer of the value passed is aligned on a 4 byte
...
...
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