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
548d39de
Commit
548d39de
authored
Jan 30, 2012
by
Gopal Shankar
Browse files
Options
Browse Files
Download
Plain Diff
Merged from mysql-5.1-security
parents
c4367254
5fe4986c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
mysql-test/r/sp-bugs.result
mysql-test/r/sp-bugs.result
+19
-0
mysql-test/t/sp-bugs.test
mysql-test/t/sp-bugs.test
+24
-0
sql/sql_class.cc
sql/sql_class.cc
+2
-2
No files found.
mysql-test/r/sp-bugs.result
View file @
548d39de
...
...
@@ -111,4 +111,23 @@ DROP FUNCTION db1.f1;
DROP TABLE db1.t1;
DROP DATABASE db1;
DROP DATABASE db2;
#
# Bug#13105873:valgrind warning:possible crash in foreign
# key handling on subsequent create table if not exists
#
DROP DATABASE IF EXISTS testdb;
CREATE DATABASE testdb;
USE testdb;
CREATE TABLE t1 (id1 INT PRIMARY KEY);
CREATE PROCEDURE `p1`()
BEGIN
CREATE TABLE IF NOT EXISTS t2(id INT PRIMARY KEY,
CONSTRAINT FK FOREIGN KEY (id) REFERENCES t1( id1 ));
END$
CALL p1();
# below stmt should not return valgrind warnings
CALL p1();
Warnings:
Note 1050 Table 't2' already exists
DROP DATABASE testdb;
End of 5.1 tests
mysql-test/t/sp-bugs.test
View file @
548d39de
...
...
@@ -138,4 +138,28 @@ DROP FUNCTION db1.f1;
DROP
TABLE
db1
.
t1
;
DROP
DATABASE
db1
;
DROP
DATABASE
db2
;
--
echo
#
--
echo
# Bug#13105873:valgrind warning:possible crash in foreign
--
echo
# key handling on subsequent create table if not exists
--
echo
#
--
disable_warnings
DROP
DATABASE
IF
EXISTS
testdb
;
--
enable_warnings
CREATE
DATABASE
testdb
;
USE
testdb
;
CREATE
TABLE
t1
(
id1
INT
PRIMARY
KEY
);
DELIMITER
$
;
CREATE
PROCEDURE
`p1`
()
BEGIN
CREATE
TABLE
IF
NOT
EXISTS
t2
(
id
INT
PRIMARY
KEY
,
CONSTRAINT
FK
FOREIGN
KEY
(
id
)
REFERENCES
t1
(
id1
));
END
$
DELIMITER
;
$
CALL
p1
();
--
echo
# below stmt should not return valgrind warnings
CALL
p1
();
DROP
DATABASE
testdb
;
--
echo
End
of
5.1
tests
sql/sql_class.cc
View file @
548d39de
...
...
@@ -138,9 +138,9 @@ Key::Key(const Key &rhs, MEM_ROOT *mem_root)
*/
Foreign_key
::
Foreign_key
(
const
Foreign_key
&
rhs
,
MEM_ROOT
*
mem_root
)
:
Key
(
rhs
),
:
Key
(
rhs
,
mem_root
),
ref_table
(
rhs
.
ref_table
),
ref_columns
(
rhs
.
ref_columns
),
ref_columns
(
rhs
.
ref_columns
,
mem_root
),
delete_opt
(
rhs
.
delete_opt
),
update_opt
(
rhs
.
update_opt
),
match_opt
(
rhs
.
match_opt
)
...
...
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