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
87fb4fb4
Commit
87fb4fb4
authored
Jul 09, 2006
by
guilhem@gbichot3.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manual merge of test from 5.0 (needs to be manual because the test files
were copied/split between 5.0 and 5.1).
parent
1a506b34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
4 deletions
+105
-4
mysql-test/extra/rpl_tests/rpl_auto_increment.test
mysql-test/extra/rpl_tests/rpl_auto_increment.test
+39
-1
mysql-test/extra/rpl_tests/rpl_insert_id.test
mysql-test/extra/rpl_tests/rpl_insert_id.test
+63
-0
mysql-test/r/rpl_auto_increment.result
mysql-test/r/rpl_auto_increment.result
+3
-3
No files found.
mysql-test/extra/rpl_tests/rpl_auto_increment.test
View file @
87fb4fb4
...
@@ -104,9 +104,47 @@ select * from t1;
...
@@ -104,9 +104,47 @@ select * from t1;
sync_slave_with_master
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
;
connection
master
;
# Test for BUG#20524 "auto_increment_* not observed when inserting
# a too large value". When an autogenerated value was bigger than the
# maximum possible value of the field, it was truncated to that max
# possible value, without being "rounded down" to still honour
# auto_increment_* variables.
connection
master
;
drop
table
t1
;
drop
table
t1
;
create
table
t1
(
a
tinyint
not
null
auto_increment
primary
key
)
engine
=
myisam
;
insert
into
t1
values
(
103
);
set
auto_increment_increment
=
11
;
set
auto_increment_offset
=
4
;
insert
into
t1
values
(
null
);
insert
into
t1
values
(
null
);
--
error
1062
insert
into
t1
values
(
null
);
select
a
,
mod
(
a
-@@
auto_increment_offset
,
@@
auto_increment_increment
)
from
t1
order
by
a
;
# same but with a larger value
create
table
t2
(
a
tinyint
unsigned
not
null
auto_increment
primary
key
)
engine
=
myisam
;
set
auto_increment_increment
=
10
;
set
auto_increment_offset
=
1
;
set
insert_id
=
1000
;
insert
into
t2
values
(
null
);
select
a
,
mod
(
a
-@@
auto_increment_offset
,
@@
auto_increment_increment
)
from
t2
order
by
a
;
# An offset so big that even first value does not fit
create
table
t3
like
t1
;
set
auto_increment_increment
=
1000
;
set
auto_increment_offset
=
700
;
insert
into
t3
values
(
null
);
select
*
from
t3
order
by
a
;
sync_slave_with_master
;
select
*
from
t1
order
by
a
;
select
*
from
t2
order
by
a
;
select
*
from
t3
order
by
a
;
connection
master
;
drop
table
t1
,
t2
,
t3
;
# End cleanup
# End cleanup
sync_slave_with_master
;
sync_slave_with_master
;
mysql-test/extra/rpl_tests/rpl_insert_id.test
View file @
87fb4fb4
...
@@ -155,6 +155,69 @@ drop function bug15728;
...
@@ -155,6 +155,69 @@ drop function bug15728;
drop
function
bug15728_insert
;
drop
function
bug15728_insert
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
# test of BUG#20188 REPLACE or ON DUPLICATE KEY UPDATE in
# auto_increment breaks binlog
create
table
t1
(
n
int
primary
key
auto_increment
not
null
,
b
int
,
unique
(
b
));
# First, test that we do not call restore_auto_increment() too early
# in write_record():
set
sql_log_bin
=
0
;
insert
into
t1
values
(
null
,
100
);
replace
into
t1
values
(
null
,
50
),(
null
,
100
),(
null
,
150
);
select
*
from
t1
order
by
n
;
truncate
table
t1
;
set
sql_log_bin
=
1
;
insert
into
t1
values
(
null
,
100
);
select
*
from
t1
order
by
n
;
sync_slave_with_master
;
# make slave's table autoinc counter bigger
insert
into
t1
values
(
null
,
200
),(
null
,
300
);
delete
from
t1
where
b
<>
100
;
# check that slave's table content is identical to master
select
*
from
t1
order
by
n
;
# only the auto_inc counter differs.
connection
master
;
replace
into
t1
values
(
null
,
100
),(
null
,
350
);
select
*
from
t1
order
by
n
;
sync_slave_with_master
;
select
*
from
t1
order
by
n
;
# Same test as for REPLACE, but for ON DUPLICATE KEY UPDATE
# We first check that if we update a row using a value larger than the
# table's counter, the counter for next row is bigger than the
# after-value of the updated row.
connection
master
;
insert
into
t1
values
(
NULL
,
400
),(
3
,
500
),(
NULL
,
600
)
on
duplicate
key
UPDATE
n
=
1000
;
select
*
from
t1
order
by
n
;
sync_slave_with_master
;
select
*
from
t1
order
by
n
;
# and now test for the bug:
connection
master
;
drop
table
t1
;
create
table
t1
(
n
int
primary
key
auto_increment
not
null
,
b
int
,
unique
(
b
));
insert
into
t1
values
(
null
,
100
);
select
*
from
t1
order
by
n
;
sync_slave_with_master
;
insert
into
t1
values
(
null
,
200
),(
null
,
300
);
delete
from
t1
where
b
<>
100
;
select
*
from
t1
order
by
n
;
connection
master
;
insert
into
t1
values
(
null
,
100
),(
null
,
350
)
on
duplicate
key
update
n
=
2
;
select
*
from
t1
order
by
n
;
sync_slave_with_master
;
select
*
from
t1
order
by
n
;
connection
master
;
drop
table
t1
;
# End of 5.0 tests
# End of 5.0 tests
sync_slave_with_master
;
sync_slave_with_master
;
mysql-test/r/rpl_auto_increment.result
View file @
87fb4fb4
...
@@ -190,7 +190,7 @@ set auto_increment_offset=4;
...
@@ -190,7 +190,7 @@ set auto_increment_offset=4;
insert into t1 values(null);
insert into t1 values(null);
insert into t1 values(null);
insert into t1 values(null);
insert into t1 values(null);
insert into t1 values(null);
ERROR 23000: Duplicate entry '125' for key
1
ERROR 23000: Duplicate entry '125' for key
'PRIMARY'
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;
a mod(a-@@auto_increment_offset,@@auto_increment_increment)
a mod(a-@@auto_increment_offset,@@auto_increment_increment)
103 0
103 0
...
@@ -202,7 +202,7 @@ set auto_increment_offset=1;
...
@@ -202,7 +202,7 @@ set auto_increment_offset=1;
set insert_id=1000;
set insert_id=1000;
insert into t2 values(null);
insert into t2 values(null);
Warnings:
Warnings:
Warning 1264 Out of range value
adjusted
for column 'a' at row 1
Warning 1264 Out of range value for column 'a' at row 1
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a;
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a;
a mod(a-@@auto_increment_offset,@@auto_increment_increment)
a mod(a-@@auto_increment_offset,@@auto_increment_increment)
251 0
251 0
...
@@ -211,7 +211,7 @@ set auto_increment_increment=1000;
...
@@ -211,7 +211,7 @@ set auto_increment_increment=1000;
set auto_increment_offset=700;
set auto_increment_offset=700;
insert into t3 values(null);
insert into t3 values(null);
Warnings:
Warnings:
Warning 1264 Out of range value
adjusted
for column 'a' at row 1
Warning 1264 Out of range value for column 'a' at row 1
select * from t3 order by a;
select * from t3 order by a;
a
a
127
127
...
...
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