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
fab3038d
Commit
fab3038d
authored
Nov 24, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jonas/src/wl2077
into mysql.com:/home/jonas/src/mysql-4.1
parents
482a446b
0978d302
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
557 additions
and
1761 deletions
+557
-1761
.bzrignore
.bzrignore
+1
-0
VC++Files/client/mysqladmin.dsp
VC++Files/client/mysqladmin.dsp
+1
-1
extra/perror.c
extra/perror.c
+1
-1
heap/hp_rfirst.c
heap/hp_rfirst.c
+1
-0
myisam/ft_boolean_search.c
myisam/ft_boolean_search.c
+2
-2
myisam/mi_create.c
myisam/mi_create.c
+6
-4
mysql-test/mysql_test_run.c
mysql-test/mysql_test_run.c
+0
-1728
mysql-test/r/delete.result
mysql-test/r/delete.result
+26
-4
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+8
-0
mysql-test/r/heap.result
mysql-test/r/heap.result
+7
-0
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+18
-0
mysql-test/r/key.result
mysql-test/r/key.result
+18
-0
mysql-test/r/range.result
mysql-test/r/range.result
+2
-2
mysql-test/r/type_blob.result
mysql-test/r/type_blob.result
+2
-2
mysql-test/t/delete.test
mysql-test/t/delete.test
+26
-4
mysql-test/t/fulltext.test
mysql-test/t/fulltext.test
+2
-0
mysql-test/t/heap.test
mysql-test/t/heap.test
+11
-0
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+22
-0
mysql-test/t/key.test
mysql-test/t/key.test
+23
-0
mysql-test/t/rpl000001.test
mysql-test/t/rpl000001.test
+1
-1
mysql-test/t/type_blob.test
mysql-test/t/type_blob.test
+2
-2
ndb/include/ndbapi/NdbConnection.hpp
ndb/include/ndbapi/NdbConnection.hpp
+2
-2
ndb/src/ndbapi/NdbConnection.cpp
ndb/src/ndbapi/NdbConnection.cpp
+36
-0
ndb/test/ndbapi/testBlobs.cpp
ndb/test/ndbapi/testBlobs.cpp
+302
-1
sql/handler.cc
sql/handler.cc
+3
-1
sql/mysqld.cc
sql/mysqld.cc
+19
-4
sql/sql_select.cc
sql/sql_select.cc
+1
-1
sql/sql_table.cc
sql/sql_table.cc
+14
-1
No files found.
.bzrignore
View file @
fab3038d
...
...
@@ -939,3 +939,4 @@ ndbcluster-1186/ndb_3_cluster.log
ndbcluster-1186/ndb_3_out.log
ndbcluster-1186/ndbcluster.pid
ndb/tools/ndb_restore
ac_available_languages_fragment
VC++Files/client/mysqladmin.dsp
View file @
fab3038d
...
...
@@ -115,7 +115,7 @@ LINK32=xilink6.exe
# Name "mysqladmin - Win32 classic"
# Begin Source File
SOURCE=.\mysqladmin.c
SOURCE=.\mysqladmin.c
pp
# End Source File
# End Target
# End Project
extra/perror.c
View file @
fab3038d
...
...
@@ -69,7 +69,7 @@ static HA_ERRORS ha_errlist[]=
{
{
120
,
"Didn't find key on read or update"
},
{
121
,
"Duplicate key on write or update"
},
{
123
,
"Someone has changed the row since it was read
; Update with is recoverable
"
},
{
123
,
"Someone has changed the row since it was read
(while the table was locked to prevent it)
"
},
{
124
,
"Wrong index given to function"
},
{
126
,
"Index file is crashed"
},
{
127
,
"Record-file is crashed"
},
...
...
heap/hp_rfirst.c
View file @
fab3038d
...
...
@@ -52,6 +52,7 @@ int heap_rfirst(HP_INFO *info, byte *record, int inx)
my_errno
=
HA_ERR_END_OF_FILE
;
DBUG_RETURN
(
my_errno
);
}
DBUG_ASSERT
(
0
);
/* TODO fix it */
info
->
current_record
=
0
;
info
->
current_hash_ptr
=
0
;
info
->
update
=
HA_STATE_PREV_FOUND
;
...
...
myisam/ft_boolean_search.c
View file @
fab3038d
...
...
@@ -348,7 +348,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
FTB_EXPR
*
top_ftbe
=
ftbe
->
up
->
up
;
ftbw
->
docid
[
0
]
=
HA_OFFSET_ERROR
;
for
(
ftbe
=
ftbw
->
up
;
ftbe
!=
top_ftbe
;
ftbe
=
ftbe
->
up
)
if
(
ftbe
->
flags
&
FTB_FLAG_YES
)
if
(
!
(
ftbe
->
flags
&
FTB_FLAG_NO
)
)
ftbe
->
yweaks
++
;
ftbe
=
0
;
break
;
...
...
@@ -356,7 +356,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
}
if
(
!
ftbe
)
continue
;
/*
3
*/
/*
4
*/
if
(
!
is_tree_inited
(
&
ftb
->
no_dupes
))
init_tree
(
&
ftb
->
no_dupes
,
0
,
0
,
sizeof
(
my_off_t
),
_ftb_no_dupes_cmp
,
0
,
0
,
0
);
...
...
myisam/mi_create.c
View file @
fab3038d
...
...
@@ -16,7 +16,7 @@
/* Create a MyISAM table */
#include "f
ulltext
.h"
#include "f
tdefs
.h"
#include "sp_defs.h"
#if defined(MSDOS) || defined(__WIN__)
...
...
@@ -41,7 +41,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
File
dfile
,
file
;
int
errpos
,
save_errno
;
myf
create_flag
;
uint
fields
,
length
,
max_key_length
,
packed
,
pointer
,
uint
fields
,
length
,
max_key_length
,
packed
,
pointer
,
real_length_diff
,
key_length
,
info_length
,
key_segs
,
options
,
min_key_length_skip
,
base_pos
,
varchar_count
,
long_varchar_count
,
varchar_length
,
max_key_block_length
,
unique_key_parts
,
fulltext_keys
,
offset
;
...
...
@@ -238,7 +238,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
{
share
.
state
.
key_root
[
i
]
=
HA_OFFSET_ERROR
;
min_key_length_skip
=
length
=
0
;
min_key_length_skip
=
length
=
real_length_diff
=
0
;
key_length
=
pointer
;
if
(
keydef
->
flag
&
HA_SPATIAL
)
{
...
...
@@ -297,6 +297,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
key_length
+=
HA_FT_MAXBYTELEN
+
HA_FT_WLEN
;
length
++
;
/* At least one length byte */
min_key_length_skip
+=
HA_FT_MAXBYTELEN
;
real_length_diff
=
HA_FT_MAXBYTELEN
-
FT_MAX_WORD_LEN_FOR_SORT
;
}
else
{
...
...
@@ -397,7 +398,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
key_segs
)
share
.
state
.
rec_per_key_part
[
key_segs
-
1
]
=
1L
;
length
+=
key_length
;
keydef
->
block_length
=
MI_BLOCK_SIZE
(
length
,
pointer
,
MI_MAX_KEYPTR_SIZE
);
keydef
->
block_length
=
MI_BLOCK_SIZE
(
length
-
real_length_diff
,
pointer
,
MI_MAX_KEYPTR_SIZE
);
if
(
keydef
->
block_length
>
MI_MAX_KEY_BLOCK_LENGTH
||
length
>=
MI_MAX_KEY_BUFF
)
{
...
...
mysql-test/mysql_test_run.c
deleted
100644 → 0
View file @
482a446b
This diff is collapsed.
Click to expand it.
mysql-test/r/delete.result
View file @
fab3038d
...
...
@@ -16,12 +16,34 @@ SET AUTOCOMMIT=0;
DELETE from t1;
SET AUTOCOMMIT=1;
drop table t1;
create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23);
create table t1 (
a bigint not null,
b bigint not null default 0,
c bigint not null default 0,
d bigint not null default 0,
e bigint not null default 0,
f bigint not null default 0,
g bigint not null default 0,
h bigint not null default 0,
i bigint not null default 0,
j bigint not null default 0,
primary key (a,b,c,d,e,f,g,h,i,j));
insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23);
delete from t1 where a=26;
drop table t1;
create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
create table t1 (
a bigint not null,
b bigint not null default 0,
c bigint not null default 0,
d bigint not null default 0,
e bigint not null default 0,
f bigint not null default 0,
g bigint not null default 0,
h bigint not null default 0,
i bigint not null default 0,
j bigint not null default 0,
primary key (a,b,c,d,e,f,g,h,i,j));
insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
delete from t1 where a=27;
drop table t1;
CREATE TABLE `t1` (
...
...
mysql-test/r/fulltext.result
View file @
fab3038d
...
...
@@ -190,6 +190,14 @@ a
select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode);
a
aaa10 bbb20
select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode);
a
aaa20 bbb15
aaa30 bbb10
select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode);
a
aaa20 bbb15
aaa30 bbb10
drop table t1;
CREATE TABLE t1 (
id int(11),
...
...
mysql-test/r/heap.result
View file @
fab3038d
...
...
@@ -233,3 +233,10 @@ SELECT * FROM t1 WHERE B is not null;
a B
1 1
DROP TABLE t1;
CREATE TABLE t1 (pseudo char(35) PRIMARY KEY, date int(10) unsigned NOT NULL) ENGINE=HEAP;
INSERT INTO t1 VALUES ('massecot',1101106491),('altec',1101106492),('stitch+',1101106304),('Seb Corgan',1101106305),('beerfilou',1101106263),('flaker',1101106529),('joce8',5),('M4vrick',1101106418),('gabay008',1101106525),('Vamp irX',1101106291),('ZoomZip',1101106546),('rip666',1101106502),('CBP ',1101106397),('guezpard',1101106496);
DELETE FROM t1 WHERE date<1101106546;
SELECT * FROM t1;
pseudo date
ZoomZip 1101106546
DROP TABLE t1;
mysql-test/r/innodb.result
View file @
fab3038d
...
...
@@ -1630,3 +1630,21 @@ show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
drop table t1;
create table t1 (c char(10), index (c,c)) engine=innodb;
ERROR 42S21: Duplicate column name 'c'
create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
ERROR 42S21: Duplicate column name 'c1'
create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
ERROR 42S21: Duplicate column name 'c1'
create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
ERROR 42S21: Duplicate column name 'c1'
create table t1 (c1 char(10), c2 char(10)) engine=innodb;
alter table t1 add key (c1,c1);
ERROR 42S21: Duplicate column name 'c1'
alter table t1 add key (c2,c1,c1);
ERROR 42S21: Duplicate column name 'c1'
alter table t1 add key (c1,c2,c1);
ERROR 42S21: Duplicate column name 'c1'
alter table t1 add key (c1,c1,c2);
ERROR 42S21: Duplicate column name 'c1'
drop table t1;
mysql-test/r/key.result
View file @
fab3038d
...
...
@@ -307,3 +307,21 @@ test.t1 check status OK
drop table t1;
create table t1 (c char(10), index (c(0)));
ERROR HY000: Key part 'c' length cannot be 0
create table t1 (c char(10), index (c,c));
ERROR 42S21: Duplicate column name 'c'
create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1));
ERROR 42S21: Duplicate column name 'c1'
create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2));
ERROR 42S21: Duplicate column name 'c1'
create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1));
ERROR 42S21: Duplicate column name 'c1'
create table t1 (c1 char(10), c2 char(10));
alter table t1 add key (c1,c1);
ERROR 42S21: Duplicate column name 'c1'
alter table t1 add key (c2,c1,c1);
ERROR 42S21: Duplicate column name 'c1'
alter table t1 add key (c1,c2,c1);
ERROR 42S21: Duplicate column name 'c1'
alter table t1 add key (c1,c1,c2);
ERROR 42S21: Duplicate column name 'c1'
drop table t1;
mysql-test/r/range.result
View file @
fab3038d
...
...
@@ -221,7 +221,7 @@ update t1 set y=x;
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref y y 5 const 1 Using where
1 SIMPLE t2 range x x 5 NULL 4
Using where
1 SIMPLE t2 range x x 5 NULL 4
Range checked for each record (index map: 0x1)
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref y y 5 const 1 Using where
...
...
@@ -237,7 +237,7 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref y y 5 const 1 Using where
1 SIMPLE t2 ALL x NULL NULL NULL 9
Using where
1 SIMPLE t2 ALL x NULL NULL NULL 9
Range checked for each record (index map: 0x1)
explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref y y 5 const 1 Using where
...
...
mysql-test/r/type_blob.result
View file @
fab3038d
...
...
@@ -682,8 +682,8 @@ id txt
3 NULL
1 Chevy
drop table t1;
CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL,
PRIMARY KEY (i), KEY (c(1),c(1)
));
INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,'');
CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL,
d varchar(1) NOT NULL DEFAULT ' ', PRIMARY KEY (i), KEY (c(1),d
));
INSERT t1
(i, c)
VALUES (1,''),(2,''),(3,'asdfh'),(4,'');
select max(i) from t1 where c = '';
max(i)
4
...
...
mysql-test/t/delete.test
View file @
fab3038d
...
...
@@ -29,12 +29,34 @@ drop table t1;
# (This assumes a block size of 1024)
#
create
table
t1
(
a
bigint
not
null
,
primary
key
(
a
,
a
,
a
,
a
,
a
,
a
,
a
,
a
,
a
,
a
));
insert
into
t1
values
(
2
),(
4
),(
6
),(
8
),(
10
),(
12
),(
14
),(
16
),(
18
),(
20
),(
22
),(
24
),(
26
),(
23
);
create
table
t1
(
a
bigint
not
null
,
b
bigint
not
null
default
0
,
c
bigint
not
null
default
0
,
d
bigint
not
null
default
0
,
e
bigint
not
null
default
0
,
f
bigint
not
null
default
0
,
g
bigint
not
null
default
0
,
h
bigint
not
null
default
0
,
i
bigint
not
null
default
0
,
j
bigint
not
null
default
0
,
primary
key
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
));
insert
into
t1
(
a
)
values
(
2
),(
4
),(
6
),(
8
),(
10
),(
12
),(
14
),(
16
),(
18
),(
20
),(
22
),(
24
),(
26
),(
23
);
delete
from
t1
where
a
=
26
;
drop
table
t1
;
create
table
t1
(
a
bigint
not
null
,
primary
key
(
a
,
a
,
a
,
a
,
a
,
a
,
a
,
a
,
a
,
a
));
insert
into
t1
values
(
2
),(
4
),(
6
),(
8
),(
10
),(
12
),(
14
),(
16
),(
18
),(
20
),(
22
),(
24
),(
26
),(
23
),(
27
);
create
table
t1
(
a
bigint
not
null
,
b
bigint
not
null
default
0
,
c
bigint
not
null
default
0
,
d
bigint
not
null
default
0
,
e
bigint
not
null
default
0
,
f
bigint
not
null
default
0
,
g
bigint
not
null
default
0
,
h
bigint
not
null
default
0
,
i
bigint
not
null
default
0
,
j
bigint
not
null
default
0
,
primary
key
(
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
,
i
,
j
));
insert
into
t1
(
a
)
values
(
2
),(
4
),(
6
),(
8
),(
10
),(
12
),(
14
),(
16
),(
18
),(
20
),(
22
),(
24
),(
26
),(
23
),(
27
);
delete
from
t1
where
a
=
27
;
drop
table
t1
;
...
...
mysql-test/t/fulltext.test
View file @
fab3038d
...
...
@@ -98,6 +98,8 @@ select * from t1 where match a against ("+aaa* +bbb*" in boolean mode);
select
*
from
t1
where
match
a
against
(
"+aaa* +bbb1*"
in
boolean
mode
);
select
*
from
t1
where
match
a
against
(
"+aaa* +ccc*"
in
boolean
mode
);
select
*
from
t1
where
match
a
against
(
"+aaa10 +(bbb*)"
in
boolean
mode
);
select
*
from
t1
where
match
a
against
(
"+(+aaa* +bbb1*)"
in
boolean
mode
);
select
*
from
t1
where
match
a
against
(
"(+aaa* +bbb1*)"
in
boolean
mode
);
drop
table
t1
;
#
...
...
mysql-test/t/heap.test
View file @
fab3038d
...
...
@@ -174,3 +174,14 @@ CREATE TABLE t1 (a INT NOT NULL, B INT, KEY(B)) ENGINE=HEAP;
INSERT
INTO
t1
VALUES
(
1
,
1
),
(
1
,
NULL
);
SELECT
*
FROM
t1
WHERE
B
is
not
null
;
DROP
TABLE
t1
;
#
# Bug #6748
# heap_rfirst() doesn't work (and never did!)
#
CREATE
TABLE
t1
(
pseudo
char
(
35
)
PRIMARY
KEY
,
date
int
(
10
)
unsigned
NOT
NULL
)
ENGINE
=
HEAP
;
INSERT
INTO
t1
VALUES
(
'massecot'
,
1101106491
),(
'altec'
,
1101106492
),(
'stitch+'
,
1101106304
),(
'Seb Corgan'
,
1101106305
),(
'beerfilou'
,
1101106263
),(
'flaker'
,
1101106529
),(
'joce8'
,
5
),(
'M4vrick'
,
1101106418
),(
'gabay008'
,
1101106525
),(
'Vamp irX'
,
1101106291
),(
'ZoomZip'
,
1101106546
),(
'rip666'
,
1101106502
),(
'CBP '
,
1101106397
),(
'guezpard'
,
1101106496
);
DELETE
FROM
t1
WHERE
date
<
1101106546
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
mysql-test/t/innodb.test
View file @
fab3038d
...
...
@@ -1158,3 +1158,25 @@ show status like "binlog_cache_use";
show
status
like
"binlog_cache_disk_use"
;
drop
table
t1
;
#
# Bug #6126: Duplicate columns in keys gives misleading error message
#
--
error
1060
create
table
t1
(
c
char
(
10
),
index
(
c
,
c
))
engine
=
innodb
;
--
error
1060
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
),
index
(
c1
,
c2
,
c1
))
engine
=
innodb
;
--
error
1060
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
),
index
(
c1
,
c1
,
c2
))
engine
=
innodb
;
--
error
1060
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
),
index
(
c2
,
c1
,
c1
))
engine
=
innodb
;
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
))
engine
=
innodb
;
--
error
1060
alter
table
t1
add
key
(
c1
,
c1
);
--
error
1060
alter
table
t1
add
key
(
c2
,
c1
,
c1
);
--
error
1060
alter
table
t1
add
key
(
c1
,
c2
,
c1
);
--
error
1060
alter
table
t1
add
key
(
c1
,
c1
,
c2
);
drop
table
t1
;
mysql-test/t/key.test
View file @
fab3038d
...
...
@@ -297,3 +297,26 @@ drop table t1;
--
error
1105
create
table
t1
(
c
char
(
10
),
index
(
c
(
0
)));
#
# Bug #6126: Duplicate columns in keys should fail
# Bug #6252: (dup)
#
--
error
1060
create
table
t1
(
c
char
(
10
),
index
(
c
,
c
));
--
error
1060
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
),
index
(
c1
,
c2
,
c1
));
--
error
1060
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
),
index
(
c1
,
c1
,
c2
));
--
error
1060
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
),
index
(
c2
,
c1
,
c1
));
create
table
t1
(
c1
char
(
10
),
c2
char
(
10
));
--
error
1060
alter
table
t1
add
key
(
c1
,
c1
);
--
error
1060
alter
table
t1
add
key
(
c2
,
c1
,
c1
);
--
error
1060
alter
table
t1
add
key
(
c1
,
c2
,
c1
);
--
error
1060
alter
table
t1
add
key
(
c1
,
c1
,
c2
);
drop
table
t1
;
mysql-test/t/rpl000001.test
View file @
fab3038d
...
...
@@ -98,7 +98,7 @@ wait_for_slave_to_stop;
# The following test can't be done because the result of Pos will differ
# on different computers
# --replace_result
9306 9999 3334 9999 3335 9999
# --replace_result
$MASTER_MYPORT MASTER_PORT
# show slave status;
set
global
sql_slave_skip_counter
=
1
;
...
...
mysql-test/t/type_blob.test
View file @
fab3038d
...
...
@@ -369,8 +369,8 @@ explain select * from t1 where txt='Chevy' or txt is NULL order by txt;
select
*
from
t1
where
txt
=
'Chevy'
or
txt
is
NULL
order
by
txt
;
drop
table
t1
;
CREATE
TABLE
t1
(
i
int
(
11
)
NOT
NULL
default
'0'
,
c
text
NOT
NULL
,
PRIMARY
KEY
(
i
),
KEY
(
c
(
1
),
c
(
1
)
));
INSERT
t1
VALUES
(
1
,
''
),(
2
,
''
),(
3
,
'asdfh'
),(
4
,
''
);
CREATE
TABLE
t1
(
i
int
(
11
)
NOT
NULL
default
'0'
,
c
text
NOT
NULL
,
d
varchar
(
1
)
NOT
NULL
DEFAULT
' '
,
PRIMARY
KEY
(
i
),
KEY
(
c
(
1
),
d
));
INSERT
t1
(
i
,
c
)
VALUES
(
1
,
''
),(
2
,
''
),(
3
,
'asdfh'
),(
4
,
''
);
select
max
(
i
)
from
t1
where
c
=
''
;
drop
table
t1
;
...
...
ndb/include/ndbapi/NdbConnection.hpp
View file @
fab3038d
...
...
@@ -607,8 +607,8 @@ private:
NdbOperation
*
theLastExecOpInList
;
// Last executing operation in list.
NdbOperation
*
theCompletedFirstOp
;
// First operation in completed
// operation list.
NdbOperation
*
theCompletedFirstOp
;
// First
& last
operation in completed
NdbOperation
*
theCompletedLastOp
;
// operation list.
Uint32
theNoOfOpSent
;
// How many operations have been sent
Uint32
theNoOfOpCompleted
;
// How many operations have completed
...
...
ndb/src/ndbapi/NdbConnection.cpp
View file @
fab3038d
...
...
@@ -55,6 +55,7 @@ NdbConnection::NdbConnection( Ndb* aNdb ) :
theFirstExecOpInList
(
NULL
),
theLastExecOpInList
(
NULL
),
theCompletedFirstOp
(
NULL
),
theCompletedLastOp
(
NULL
),
theNoOfOpSent
(
0
),
theNoOfOpCompleted
(
0
),
theNoOfOpFetched
(
0
),
...
...
@@ -124,6 +125,7 @@ NdbConnection::init()
theLastExecOpInList
=
NULL
;
theCompletedFirstOp
=
NULL
;
theCompletedLastOp
=
NULL
;
theGlobalCheckpointId
=
0
;
theCommitStatus
=
Started
;
...
...
@@ -256,6 +258,8 @@ NdbConnection::handleExecuteCompletion()
if
(
tLastExecOp
!=
NULL
)
{
tLastExecOp
->
next
(
theCompletedFirstOp
);
theCompletedFirstOp
=
tFirstExecOp
;
if
(
theCompletedLastOp
==
NULL
)
theCompletedLastOp
=
tLastExecOp
;
theFirstExecOpInList
=
NULL
;
theLastExecOpInList
=
NULL
;
}
//if
...
...
@@ -292,6 +296,8 @@ NdbConnection::execute(ExecType aTypeOfExec,
ExecType
tExecType
;
NdbOperation
*
tPrepOp
;
NdbOperation
*
tCompletedFirstOp
=
NULL
;
NdbOperation
*
tCompletedLastOp
=
NULL
;
int
ret
=
0
;
do
{
...
...
@@ -314,6 +320,7 @@ NdbConnection::execute(ExecType aTypeOfExec,
}
tPrepOp
=
tPrepOp
->
next
();
}
// save rest of prepared ops if batch
NdbOperation
*
tRestOp
=
0
;
NdbOperation
*
tLastOp
=
0
;
...
...
@@ -323,6 +330,7 @@ NdbConnection::execute(ExecType aTypeOfExec,
tLastOp
=
theLastOpInList
;
theLastOpInList
=
tPrepOp
;
}
if
(
tExecType
==
Commit
)
{
NdbOperation
*
tOp
=
theCompletedFirstOp
;
while
(
tOp
!=
NULL
)
{
...
...
@@ -338,6 +346,19 @@ NdbConnection::execute(ExecType aTypeOfExec,
}
}
// completed ops are in unspecified order
if
(
theCompletedFirstOp
!=
NULL
)
{
if
(
tCompletedFirstOp
==
NULL
)
{
tCompletedFirstOp
=
theCompletedFirstOp
;
tCompletedLastOp
=
theCompletedLastOp
;
}
else
{
tCompletedLastOp
->
next
(
theCompletedFirstOp
);
tCompletedLastOp
=
theCompletedLastOp
;
}
theCompletedFirstOp
=
NULL
;
theCompletedLastOp
=
NULL
;
}
if
(
executeNoBlobs
(
tExecType
,
abortOption
,
forceSend
)
==
-
1
)
ret
=
-
1
;
#ifndef VM_TRACE
...
...
@@ -362,6 +383,7 @@ NdbConnection::execute(ExecType aTypeOfExec,
tOp
=
tOp
->
next
();
}
}
// add saved prepared ops if batch
if
(
tPrepOp
!=
NULL
&&
tRestOp
!=
NULL
)
{
if
(
theFirstOpInList
==
NULL
)
...
...
@@ -373,6 +395,18 @@ NdbConnection::execute(ExecType aTypeOfExec,
assert
(
theFirstOpInList
==
NULL
||
tExecType
==
NoCommit
);
}
while
(
theFirstOpInList
!=
NULL
||
tExecType
!=
aTypeOfExec
);
if
(
tCompletedFirstOp
!=
NULL
)
{
tCompletedLastOp
->
next
(
theCompletedFirstOp
);
theCompletedFirstOp
=
tCompletedFirstOp
;
if
(
theCompletedLastOp
==
NULL
)
theCompletedLastOp
=
tCompletedLastOp
;
}
#if ndb_api_count_completed_ops_after_blob_execute
{
NdbOperation
*
tOp
;
unsigned
n
=
0
;
for
(
tOp
=
theCompletedFirstOp
;
tOp
!=
NULL
;
tOp
=
tOp
->
next
())
n
++
;
ndbout
<<
"completed ops: "
<<
n
<<
endl
;
}
#endif
DBUG_RETURN
(
ret
);
}
...
...
@@ -894,6 +928,7 @@ NdbConnection::releaseOperations()
releaseOps
(
theFirstExecOpInList
);
theCompletedFirstOp
=
NULL
;
theCompletedLastOp
=
NULL
;
theFirstOpInList
=
NULL
;
theFirstExecOpInList
=
NULL
;
theLastOpInList
=
NULL
;
...
...
@@ -909,6 +944,7 @@ NdbConnection::releaseCompletedOperations()
{
releaseOps
(
theCompletedFirstOp
);
theCompletedFirstOp
=
NULL
;
theCompletedLastOp
=
NULL
;
}
//NdbConnection::releaseOperations()
/******************************************************************************
...
...
ndb/test/ndbapi/testBlobs.cpp
View file @
fab3038d
This diff is collapsed.
Click to expand it.
sql/handler.cc
View file @
fab3038d
...
...
@@ -953,8 +953,10 @@ int handler::read_first_row(byte * buf, uint primary_key)
/*
If there is very few deleted rows in the table, find the first row by
scanning the table.
TODO remove the test for HA_READ_ORDER
*/
if
(
deleted
<
10
||
primary_key
>=
MAX_KEY
)
if
(
deleted
<
10
||
primary_key
>=
MAX_KEY
||
!
(
index_flags
(
primary_key
,
0
,
0
)
&
HA_READ_ORDER
))
{
(
void
)
ha_rnd_init
(
1
);
while
((
error
=
rnd_next
(
buf
))
==
HA_ERR_RECORD_DELETED
)
;
...
...
sql/mysqld.cc
View file @
fab3038d
...
...
@@ -468,6 +468,7 @@ Query_cache query_cache;
#ifdef HAVE_SMEM
char
*
shared_memory_base_name
=
default_shared_memory_base_name
;
bool
opt_enable_shared_memory
;
HANDLE
smem_event_connect_request
=
0
;
#endif
#include "sslopt-vars.h"
...
...
@@ -743,6 +744,15 @@ void kill_mysql(void)
CloseHandle(hEvent);
*/
}
#ifdef HAVE_SMEM
/*
Send event to smem_event_connect_request for aborting
*/
if
(
!
SetEvent
(
smem_event_connect_request
))
{
DBUG_PRINT
(
"error"
,(
"Got error: %ld from SetEvent of smem_event_connect_request"
,
GetLastError
()));
}
#endif
#endif
#elif defined(OS2)
pthread_cond_signal
(
&
eventShutdown
);
// post semaphore
...
...
@@ -3705,7 +3715,6 @@ pthread_handler_decl(handle_connections_shared_memory,arg)
/* file-mapping object, use for create shared memory */
HANDLE
handle_connect_file_map
=
0
;
char
*
handle_connect_map
=
0
;
// pointer on shared memory
HANDLE
event_connect_request
=
0
;
// for start connection actions
HANDLE
event_connect_answer
=
0
;
ulong
smem_buffer_length
=
shared_memory_buffer_length
+
4
;
ulong
connect_number
=
1
;
...
...
@@ -3726,7 +3735,7 @@ pthread_handler_decl(handle_connections_shared_memory,arg)
*/
suffix_pos
=
strxmov
(
tmp
,
shared_memory_base_name
,
"_"
,
NullS
);
strmov
(
suffix_pos
,
"CONNECT_REQUEST"
);
if
((
event_connect_request
=
CreateEvent
(
0
,
FALSE
,
FALSE
,
tmp
))
==
0
)
if
((
smem_
event_connect_request
=
CreateEvent
(
0
,
FALSE
,
FALSE
,
tmp
))
==
0
)
{
errmsg
=
"Could not create request event"
;
goto
error
;
...
...
@@ -3757,7 +3766,13 @@ pthread_handler_decl(handle_connections_shared_memory,arg)
while
(
!
abort_loop
)
{
/* Wait a request from client */
WaitForSingleObject
(
event_connect_request
,
INFINITE
);
WaitForSingleObject
(
smem_event_connect_request
,
INFINITE
);
/*
it can be after shutdown command
*/
if
(
abort_loop
)
goto
error
;
HANDLE
handle_client_file_map
=
0
;
char
*
handle_client_map
=
0
;
...
...
@@ -3882,7 +3897,7 @@ pthread_handler_decl(handle_connections_shared_memory,arg)
if
(
handle_connect_map
)
UnmapViewOfFile
(
handle_connect_map
);
if
(
handle_connect_file_map
)
CloseHandle
(
handle_connect_file_map
);
if
(
event_connect_answer
)
CloseHandle
(
event_connect_answer
);
if
(
event_connect_request
)
CloseHandle
(
event_connect_request
);
if
(
smem_event_connect_request
)
CloseHandle
(
smem_
event_connect_request
);
decrement_handler_count
();
DBUG_RETURN
(
0
);
...
...
sql/sql_select.cc
View file @
fab3038d
...
...
@@ -2154,7 +2154,7 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, COND *cond,
bool
is_const
=
1
;
for
(
uint
i
=
0
;
i
<
num_values
;
i
++
)
is_const
&=
(
*
value
)
->
const_item
();
is_const
&=
value
[
i
]
->
const_item
();
if
(
is_const
)
stat
[
0
].
const_keys
.
merge
(
possible_keys
);
/*
...
...
sql/sql_table.cc
View file @
fab3038d
...
...
@@ -835,7 +835,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
#endif
}
List_iterator
<
key_part_spec
>
cols
(
key
->
columns
);
List_iterator
<
key_part_spec
>
cols
(
key
->
columns
)
,
cols2
(
key
->
columns
)
;
CHARSET_INFO
*
ft_key_charset
=
0
;
// for FULLTEXT
for
(
uint
column_nr
=
0
;
(
column
=
cols
++
)
;
column_nr
++
)
{
...
...
@@ -853,6 +853,19 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info,
column
->
field_name
);
DBUG_RETURN
(
-
1
);
}
for
(
uint
dup_nr
=
0
;
dup_nr
<
column_nr
;
dup_nr
++
)
{
key_part_spec
*
dup_column
=
cols2
++
;
if
(
!
my_strcasecmp
(
system_charset_info
,
column
->
field_name
,
dup_column
->
field_name
))
{
my_printf_error
(
ER_DUP_FIELDNAME
,
ER
(
ER_DUP_FIELDNAME
),
MYF
(
0
),
column
->
field_name
);
DBUG_RETURN
(
-
1
);
}
}
cols2
.
rewind
();
/* for fulltext keys keyseg length is 1 for blobs (it's ignored in
ft code anyway, and 0 (set to column width later) for char's.
it has to be correct col width for char's, as char data are not
...
...
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