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
a35427f3
Commit
a35427f3
authored
Nov 26, 2019
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-21127 Assertion in key_text::key_text()
Unsigned type while RHS expression could be less than 0.
parent
25e2a556
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
mysql-test/suite/innodb/r/innodb-fk.result
mysql-test/suite/innodb/r/innodb-fk.result
+9
-0
mysql-test/suite/innodb/t/innodb-fk.test
mysql-test/suite/innodb/t/innodb-fk.test
+10
-0
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+3
-3
No files found.
mysql-test/suite/innodb/r/innodb-fk.result
View file @
a35427f3
...
...
@@ -190,3 +190,12 @@ bor#oda CREATE TABLE `bor#oda` (
CONSTRAINT `bor#oda_ibfk_2` FOREIGN KEY (`b`) REFERENCES `bor#oda` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
DROP TABLE `bor#oda`;
#
# MDEV-21127 Assertion `(size_t)(ptr - buf) < MAX_TEXT - 4' failed in key_text::key_text
#
CREATE TABLE t1 (
a012345678901234567890123456789012345678901 char(255),
b char(255),
FOREIGN KEY ( a012345678901234567890123456789012345678901, b ) REFERENCES tx (ax, bx)
) ENGINE=InnoDB;
ERROR HY000: Can't create table `test`.`t1` (errno: 150 "Foreign key constraint is incorrectly formed")
mysql-test/suite/innodb/t/innodb-fk.test
View file @
a35427f3
...
...
@@ -226,3 +226,13 @@ ADD FOREIGN KEY (`b`) REFERENCES `bor#oda`(`id`);
SHOW
CREATE
TABLE
`bor#oda`
;
DROP
TABLE
`bor#oda`
;
--
echo
#
--
echo
# MDEV-21127 Assertion `(size_t)(ptr - buf) < MAX_TEXT - 4' failed in key_text::key_text
--
echo
#
--
error
ER_CANT_CREATE_TABLE
CREATE
TABLE
t1
(
a012345678901234567890123456789012345678901
char
(
255
),
b
char
(
255
),
FOREIGN
KEY
(
a012345678901234567890123456789012345678901
,
b
)
REFERENCES
tx
(
ax
,
bx
)
)
ENGINE
=
InnoDB
;
storage/innobase/handler/ha_innodb.cc
View file @
a35427f3
...
...
@@ -12208,9 +12208,9 @@ class key_text
/* 3 is etc continuation ("...");
2 is comma separator (", ") in case of next exists;
1 is terminating ')' */
if
(
(
size_t
)(
ptr
-
buf
)
<
MAX_TEXT
-
(
it
.
peek
()
?
3
+
2
+
1
:
3
+
1
)
-
k
->
field_name
.
length
)
{
if
(
MAX_TEXT
-
(
size_t
)(
ptr
-
buf
)
>=
(
it
.
peek
()
?
3
+
2
+
1
:
3
+
1
)
+
k
->
field_name
.
length
)
{
memcpy
(
ptr
,
k
->
field_name
.
str
,
k
->
field_name
.
length
);
ptr
+=
k
->
field_name
.
length
;
...
...
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