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
62eee934
Commit
62eee934
authored
Jan 15, 2010
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply to XtraDB MySQL/build-in innodb patches for Bug#49032 and Bug#47720.
parent
ea328df5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
15 deletions
+45
-15
mysql-test/t/innodb-autoinc.test
mysql-test/t/innodb-autoinc.test
+6
-0
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+17
-12
storage/xtradb/row/row0sel.c
storage/xtradb/row/row0sel.c
+22
-3
No files found.
mysql-test/t/innodb-autoinc.test
View file @
62eee934
...
...
@@ -2,6 +2,8 @@
# embedded server ignores 'delayed', so skip this
--
source
include
/
not_embedded
.
inc
let
$file_format_check
=
`select @@innodb_file_format_check`
;
--
disable_warnings
drop
table
if
exists
t1
;
--
enable_warnings
...
...
@@ -655,3 +657,7 @@ REPLACE INTO t1 VALUES (-1);
SELECT
*
FROM
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
--
disable_query_log
EVAL
SET
GLOBAL
innodb_file_format_check
=
$file_format_check
;
--
enable_query_log
storage/xtradb/handler/ha_innodb.cc
View file @
62eee934
...
...
@@ -4742,24 +4742,29 @@ no_commit:
update the table upper limit. Note: last_value
will be 0 if get_auto_increment() was not called.*/
if
(
auto_inc
<=
col_max_value
&&
auto_inc
>=
prebuilt
->
autoinc_last_value
)
{
if
(
auto_inc
>=
prebuilt
->
autoinc_last_value
)
{
set_max_autoinc:
ut_a
(
prebuilt
->
autoinc_increment
>
0
);
/* This should filter out the negative
values set explicitly by the user. */
if
(
auto_inc
<=
col_max_value
)
{
ut_a
(
prebuilt
->
autoinc_increment
>
0
);
ulonglong
need
;
ulonglong
offset
;
ulonglong
need
;
ulonglong
offset
;
offset
=
prebuilt
->
autoinc_offset
;
need
=
prebuilt
->
autoinc_increment
;
offset
=
prebuilt
->
autoinc_offset
;
need
=
prebuilt
->
autoinc_increment
;
auto_inc
=
innobase_next_autoinc
(
auto_inc
,
need
,
offset
,
col_max_value
);
auto_inc
=
innobase_next_autoinc
(
auto_inc
,
need
,
offset
,
col_max_value
);
err
=
innobase_set_max_autoinc
(
auto_inc
);
err
=
innobase_set_max_autoinc
(
auto_inc
);
if
(
err
!=
DB_SUCCESS
)
{
error
=
err
;
if
(
err
!=
DB_SUCCESS
)
{
error
=
err
;
}
}
}
break
;
...
...
storage/xtradb/row/row0sel.c
View file @
62eee934
...
...
@@ -4616,6 +4616,7 @@ row_search_autoinc_read_column(
dict_index_t
*
index
,
/*!< in: index to read from */
const
rec_t
*
rec
,
/*!< in: current rec */
ulint
col_no
,
/*!< in: column number */
ulint
mtype
,
/*!< in: column main type */
ibool
unsigned_type
)
/*!< in: signed or unsigned flag */
{
ulint
len
;
...
...
@@ -4632,10 +4633,27 @@ row_search_autoinc_read_column(
data
=
rec_get_nth_field
(
rec
,
offsets
,
col_no
,
&
len
);
ut_a
(
len
!=
UNIV_SQL_NULL
);
ut_a
(
len
<=
sizeof
value
);
/* we assume AUTOINC value cannot be negative */
value
=
mach_read_int_type
(
data
,
len
,
unsigned_type
);
switch
(
mtype
)
{
case
DATA_INT
:
ut_a
(
len
<=
sizeof
value
);
value
=
mach_read_int_type
(
data
,
len
,
unsigned_type
);
break
;
case
DATA_FLOAT
:
ut_a
(
len
==
sizeof
(
float
));
value
=
mach_float_read
(
data
);
break
;
case
DATA_DOUBLE
:
ut_a
(
len
==
sizeof
(
double
));
value
=
mach_double_read
(
data
);
break
;
default:
ut_error
;
}
if
(
UNIV_LIKELY_NULL
(
heap
))
{
mem_heap_free
(
heap
);
...
...
@@ -4721,7 +4739,8 @@ row_search_max_autoinc(
dfield
->
col
->
prtype
&
DATA_UNSIGNED
);
*
value
=
row_search_autoinc_read_column
(
index
,
rec
,
i
,
unsigned_type
);
index
,
rec
,
i
,
dfield
->
col
->
mtype
,
unsigned_type
);
}
}
...
...
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