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
c4020b54
Commit
c4020b54
authored
May 20, 2024
by
Yuchen Pei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-24610 MEMORY SE: check overflow in info calls with HA_STATUS_AUTO
parent
266495b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
mysql-test/suite/parts/r/mdev_24610.result
mysql-test/suite/parts/r/mdev_24610.result
+24
-0
mysql-test/suite/parts/t/mdev_24610.test
mysql-test/suite/parts/t/mdev_24610.test
+22
-0
storage/heap/hp_info.c
storage/heap/hp_info.c
+5
-1
No files found.
mysql-test/suite/parts/r/mdev_24610.result
0 → 100644
View file @
c4020b54
CREATE TABLE t (c BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE=MEMORY PARTITION BY KEY();
INSERT INTO t VALUES (18446744073709551615);
select * from t;
c
18446744073709551615
drop table t;
CREATE TABLE t (c BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE=MEMORY;
INSERT INTO t VALUES (18446744073709551615);
ALTER TABLE t PARTITION BY KEY();
INSERT INTO t VALUES (1);
select * from t;
c
18446744073709551615
1
drop table t;
CREATE TABLE t (c BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY) ENGINE=MEMORY;
INSERT INTO t VALUES (18446744073709551615);
ALTER TABLE t PARTITION BY KEY();
INSERT INTO t VALUES (NULL);
ERROR HY000: Failed to read auto-increment value from storage engine
select * from t;
c
18446744073709551615
drop table t;
mysql-test/suite/parts/t/mdev_24610.test
0 → 100644
View file @
c4020b54
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_partition
.
inc
CREATE
TABLE
t
(
c
BIGINT
UNSIGNED
AUTO_INCREMENT
PRIMARY
KEY
)
ENGINE
=
MEMORY
PARTITION
BY
KEY
();
INSERT
INTO
t
VALUES
(
18446744073709551615
);
select
*
from
t
;
drop
table
t
;
CREATE
TABLE
t
(
c
BIGINT
UNSIGNED
AUTO_INCREMENT
PRIMARY
KEY
)
ENGINE
=
MEMORY
;
INSERT
INTO
t
VALUES
(
18446744073709551615
);
ALTER
TABLE
t
PARTITION
BY
KEY
();
INSERT
INTO
t
VALUES
(
1
);
select
*
from
t
;
drop
table
t
;
CREATE
TABLE
t
(
c
BIGINT
UNSIGNED
AUTO_INCREMENT
PRIMARY
KEY
)
ENGINE
=
MEMORY
;
INSERT
INTO
t
VALUES
(
18446744073709551615
);
ALTER
TABLE
t
PARTITION
BY
KEY
();
--
error
ER_AUTOINC_READ_FAILED
INSERT
INTO
t
VALUES
(
NULL
);
select
*
from
t
;
drop
table
t
;
storage/heap/hp_info.c
View file @
c4020b54
...
@@ -40,6 +40,10 @@ int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x, int flag )
...
@@ -40,6 +40,10 @@ int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x, int flag )
x
->
errkey
=
info
->
errkey
;
x
->
errkey
=
info
->
errkey
;
x
->
create_time
=
info
->
s
->
create_time
;
x
->
create_time
=
info
->
s
->
create_time
;
if
(
flag
&
HA_STATUS_AUTO
)
if
(
flag
&
HA_STATUS_AUTO
)
x
->
auto_increment
=
info
->
s
->
auto_increment
+
1
;
{
x
->
auto_increment
=
info
->
s
->
auto_increment
+
1
;
if
(
!
x
->
auto_increment
)
/* This shouldn't happen */
x
->
auto_increment
=
~
(
ulonglong
)
0
;
}
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
/* heap_info */
}
/* heap_info */
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