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
987f4c4d
Commit
987f4c4d
authored
21 years ago
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed AUTO_INCREMENT handling in MyISAM (last auto_increment patch broke things)
Some after merge fixes
parent
d56e2acf
No related merge requests found
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
131 additions
and
130 deletions
+131
-130
mysql-test/r/ctype_latin1_de.result
mysql-test/r/ctype_latin1_de.result
+107
-103
mysql-test/r/delete.result
mysql-test/r/delete.result
+15
-0
mysql-test/r/select.result
mysql-test/r/select.result
+0
-1
mysql-test/r/type_datetime.result
mysql-test/r/type_datetime.result
+0
-15
mysql-test/t/ctype_latin1_de.test
mysql-test/t/ctype_latin1_de.test
+2
-2
mysql-test/t/select.test
mysql-test/t/select.test
+0
-2
sql/ha_myisam.cc
sql/ha_myisam.cc
+7
-7
No files found.
mysql-test/r/ctype_latin1_de.result
View file @
987f4c4d
drop table if exists t1;
drop table if exists t1;
create table t1 (a char (20) not null, b int not null auto_increment, index (a,b)
,index(b)
);
create table t1 (a char (20) not null, b int not null auto_increment, index (a,b));
insert into t1 (a) values (''),('ac'),('ae'),('ad'),('c'),('aeb');
insert into t1 (a) values (''),('ac'),('ae'),('ad'),('c'),('aeb');
insert into t1 (a) values ('c'),('uc'),('ue'),('ud'),(''),('ueb'),('uf');
insert into t1 (a) values ('c'),('uc'),('ue'),('ud'),(''),('ueb'),('uf');
insert into t1 (a) values (''),('oc'),('a'),('oe'),('od'),('c'),('oeb');
insert into t1 (a) values (''),('oc'),('a'),('oe'),('od'),('c'),('oeb');
insert into t1 (a) values ('s'),('ss'),(''),('b'),('ssa'),('ssc'),('a');
insert into t1 (a) values ('s'),('ss'),(''),('b'),('ssa'),('ssc'),('a');
insert into t1 (a) values ('e'),('u'),('o'),(''),('a'),('aeae');
insert into t1 (a) values ('e'),('u'),('o'),(''),('a'),('aeae');
insert into t1 (a) values ('q'),('a'),('u'),('o'),(''),('');
insert into t1 (a) values ('q'),('a'),('u'),('o'),(''),('')
,('a')
;
select a,b from t1 order by a,b;
select a,b from t1 order by a,b;
a b
a b
a 35
a 1
ac 2
a 2
ad 4
ac 1
ad 1
1
1
ae
3
ae
2
3
1
1
aeae
33
aeae
2
a
32
a
1
aeb
6
aeb
1
c
5
c
1
38
1
39
2
e
28
e
1
o
37
o
1
oc 1
5
oc 1
od 1
8
od 1
1
4
1
oe
17
oe
2
a 1
6
a 1
oeb
20
oeb
1
c 1
9
c 1
o
30
o
1
q
34
q
1
s
2
1
s 1
ss
22
ss
1
2
3
2
ssa
25
ssa
1
a 2
7
a 2
b
24
b
1
ssc
26
ssc
1
u
36
u
1
uc
8
uc
1
ud 1
0
ud 1
ue
9
ue
1
11
2
ueb 1
2
ueb 1
c
7
c
1
uf 1
3
uf 1
u
29
u
1
select a,b from t1 order by upper(a),b;
select a,b from t1 order by upper(a),b;
a b
a b
a 35
a 1
ac 2
a 2
ad 4
ac 1
ad 1
1
1
ae
3
ae
2
3
1
1
aeae
33
aeae
2
a
32
a
1
aeb
6
aeb
1
c
5
c
1
38
1
39
2
e
28
e
1
o
37
o
1
oc 1
5
oc 1
od 1
8
od 1
1
4
1
oe
17
oe
2
a 1
6
a 1
oeb
20
oeb
1
c 1
9
c 1
o
30
o
1
q
34
q
1
s
2
1
s 1
ss
22
ss
1
2
3
2
ssa
25
ssa
1
a 2
7
a 2
b
24
b
1
ssc
26
ssc
1
u
36
u
1
uc
8
uc
1
ud 1
0
ud 1
ue
9
ue
1
11
2
ueb 1
2
ueb 1
c
7
c
1
uf 1
3
uf 1
u
29
u
1
select a from t1 order by a desc;
select a from t1 order by a desc;
a
a
u
u
...
@@ -129,44 +131,46 @@ ae
...
@@ -129,44 +131,46 @@ ae
ad
ad
ac
ac
a
a
a
check table t1;
check table t1;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 check status OK
test.t1 check status OK
select * from t1 where a like "%";
select * from t1 where a like "%";
a b
a b
1
4
1
a 1
6
a 1
c 1
9
c 1
o
30
o
1
select * from t1 where a like binary "%%";
select * from t1 where a like binary "%%";
a b
a b
39
2
select * from t1 where a like "%%";
select * from t1 where a like "%%";
a b
a b
a 35
a 1
ac 2
a 2
ad 4
ac 1
ae 3
ad 1
aeae 33
ae 2
a 32
aeae 2
aeb 6
a 1
a 16
aeb 1
ssa 25
a 1
a 27
ssa 1
a 2
select * from t1 where a like "%U%";
select * from t1 where a like "%U%";
a b
a b
u
36
u
1
uc
8
uc
1
ud 1
0
ud 1
ue
9
ue
1
ueb 1
2
ueb 1
uf 1
3
uf 1
u
29
u
1
select * from t1 where a like "%ss%";
select * from t1 where a like "%ss%";
a b
a b
ss
22
ss
1
ssa
25
ssa
1
ssc
26
ssc
1
drop table t1;
drop table t1;
select strcmp('','ae'),strcmp('ae',''),strcmp('aeq','q'),strcmp('q','aeq');
select strcmp('','ae'),strcmp('ae',''),strcmp('aeq','q'),strcmp('q','aeq');
strcmp('','ae') strcmp('ae','') strcmp('aeq','q') strcmp('q','aeq')
strcmp('','ae') strcmp('ae','') strcmp('aeq','q') strcmp('q','aeq')
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/delete.result
View file @
987f4c4d
...
@@ -24,3 +24,18 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
...
@@ -24,3 +24,18 @@ 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);
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
delete from t1 where a=27;
delete from t1 where a=27;
drop table t1;
drop table t1;
CREATE TABLE t1 (
bool char(0) default NULL,
not_null varchar(20) binary NOT NULL default '',
misc integer not null,
PRIMARY KEY (not_null)
) TYPE=MyISAM;
INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7);
select * from t1 where misc > 5 and bool is null;
bool not_null misc
NULL c 6
NULL d 7
delete from t1 where misc > 5 and bool is null;
select * from t1 where misc > 5 and bool is null;
bool not_null misc
drop table t1;
This diff is collapsed.
Click to expand it.
mysql-test/r/select.result
View file @
987f4c4d
use test;
drop table if exists t1,t2,t3,t4;
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
...
...
This diff is collapsed.
Click to expand it.
mysql-test/r/type_datetime.result
View file @
987f4c4d
...
@@ -78,21 +78,6 @@ EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
...
@@ -78,21 +78,6 @@ EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
table type possible_keys key key_len ref rows Extra
table type possible_keys key key_len ref rows Extra
t1 ref expedition expedition 8 const 1 Using where
t1 ref expedition expedition 8 const 1 Using where
drop table t1;
drop table t1;
CREATE TABLE `t1` (
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`numfacture` int(6) unsigned NOT NULL default '0',
`expedition` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`numfacture`),
KEY `date` (`date`),
KEY `expedition` (`expedition`)
) TYPE=MyISAM;
INSERT INTO t1 (expedition) VALUES ('0001-00-00 00:00:00');
SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
INSERT INTO t1 (numfacture,expedition) VALUES ('1212','0001-00-00 00:00:00');
SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
drop table t1;
create table t1 (a datetime not null, b datetime not null);
create table t1 (a datetime not null, b datetime not null);
insert into t1 values (now(), now());
insert into t1 values (now(), now());
insert into t1 values (now(), now());
insert into t1 values (now(), now());
...
...
This diff is collapsed.
Click to expand it.
mysql-test/t/ctype_latin1_de.test
View file @
987f4c4d
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
# Test latin_de character set
# Test latin_de character set
#
#
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
create
table
t1
(
a
char
(
20
)
not
null
,
b
int
not
null
auto_increment
,
index
(
a
,
b
)
,
index
(
b
)
);
create
table
t1
(
a
char
(
20
)
not
null
,
b
int
not
null
auto_increment
,
index
(
a
,
b
));
insert
into
t1
(
a
)
values
(
''
),(
'ac'
),(
'ae'
),(
'ad'
),(
'c'
),(
'aeb'
);
insert
into
t1
(
a
)
values
(
''
),(
'ac'
),(
'ae'
),(
'ad'
),(
'c'
),(
'aeb'
);
insert
into
t1
(
a
)
values
(
'c'
),(
'uc'
),(
'ue'
),(
'ud'
),(
''
),(
'ueb'
),(
'uf'
);
insert
into
t1
(
a
)
values
(
'c'
),(
'uc'
),(
'ue'
),(
'ud'
),(
''
),(
'ueb'
),(
'uf'
);
insert
into
t1
(
a
)
values
(
''
),(
'oc'
),(
'a'
),(
'oe'
),(
'od'
),(
'c'
),(
'oeb'
);
insert
into
t1
(
a
)
values
(
''
),(
'oc'
),(
'a'
),(
'oe'
),(
'od'
),(
'c'
),(
'oeb'
);
insert
into
t1
(
a
)
values
(
's'
),(
'ss'
),(
''
),(
'b'
),(
'ssa'
),(
'ssc'
),(
'a'
);
insert
into
t1
(
a
)
values
(
's'
),(
'ss'
),(
''
),(
'b'
),(
'ssa'
),(
'ssc'
),(
'a'
);
insert
into
t1
(
a
)
values
(
'e'
),(
'u'
),(
'o'
),(
''
),(
'a'
),(
'aeae'
);
insert
into
t1
(
a
)
values
(
'e'
),(
'u'
),(
'o'
),(
''
),(
'a'
),(
'aeae'
);
insert
into
t1
(
a
)
values
(
'q'
),(
'a'
),(
'u'
),(
'o'
),(
''
),(
''
);
insert
into
t1
(
a
)
values
(
'q'
),(
'a'
),(
'u'
),(
'o'
),(
''
),(
''
)
,(
'a'
)
;
select
a
,
b
from
t1
order
by
a
,
b
;
select
a
,
b
from
t1
order
by
a
,
b
;
select
a
,
b
from
t1
order
by
upper
(
a
),
b
;
select
a
,
b
from
t1
order
by
upper
(
a
),
b
;
select
a
from
t1
order
by
a
desc
;
select
a
from
t1
order
by
a
desc
;
...
...
This diff is collapsed.
Click to expand it.
mysql-test/t/select.test
View file @
987f4c4d
...
@@ -6,8 +6,6 @@
...
@@ -6,8 +6,6 @@
# Simple select test
# Simple select test
#
#
use
test
;
drop
table
if
exists
t1
,
t2
,
t3
,
t4
;
drop
table
if
exists
t1
,
t2
,
t3
,
t4
;
CREATE
TABLE
t1
(
CREATE
TABLE
t1
(
...
...
This diff is collapsed.
Click to expand it.
sql/ha_myisam.cc
View file @
987f4c4d
...
@@ -1021,7 +1021,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
...
@@ -1021,7 +1021,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
{
{
int
error
;
int
error
;
uint
i
,
j
,
recpos
,
minpos
,
fieldpos
,
temp_length
,
length
;
uint
i
,
j
,
recpos
,
minpos
,
fieldpos
,
temp_length
,
length
;
bool
found_
auto_increment
=
0
,
found_
real_auto_increment
=
0
;
bool
found_real_auto_increment
=
0
;
enum
ha_base_keytype
type
;
enum
ha_base_keytype
type
;
char
buff
[
FN_REFLEN
];
char
buff
[
FN_REFLEN
];
KEY
*
pos
;
KEY
*
pos
;
...
@@ -1091,12 +1091,6 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
...
@@ -1091,12 +1091,6 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
keydef
[
i
].
seg
[
j
].
null_bit
=
0
;
keydef
[
i
].
seg
[
j
].
null_bit
=
0
;
keydef
[
i
].
seg
[
j
].
null_pos
=
0
;
keydef
[
i
].
seg
[
j
].
null_pos
=
0
;
}
}
if
(
field
->
flags
&
AUTO_INCREMENT_FLAG
&&
!
found_auto_increment
)
{
keydef
[
i
].
flag
|=
HA_AUTO_KEY
;
found_auto_increment
=
1
;
found_real_auto_increment
=
(
j
==
0
);
}
if
(
field
->
type
()
==
FIELD_TYPE_BLOB
)
if
(
field
->
type
()
==
FIELD_TYPE_BLOB
)
{
{
keydef
[
i
].
seg
[
j
].
flag
|=
HA_BLOB_PART
;
keydef
[
i
].
seg
[
j
].
flag
|=
HA_BLOB_PART
;
...
@@ -1108,6 +1102,12 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
...
@@ -1108,6 +1102,12 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
keyseg
+=
pos
->
key_parts
;
keyseg
+=
pos
->
key_parts
;
}
}
if
(
table_arg
->
found_next_number_field
)
{
keydef
[
table_arg
->
next_number_index
].
flag
|=
HA_AUTO_KEY
;
found_real_auto_increment
=
table_arg
->
next_number_key_offset
==
0
;
}
recpos
=
0
;
recinfo_pos
=
recinfo
;
recpos
=
0
;
recinfo_pos
=
recinfo
;
while
(
recpos
<
(
uint
)
table_arg
->
reclength
)
while
(
recpos
<
(
uint
)
table_arg
->
reclength
)
{
{
...
...
This diff is collapsed.
Click to expand it.
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