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
2b4a942a
Commit
2b4a942a
authored
Jan 31, 2013
by
Chaithra Gopalareddy
Browse files
Options
Browse Files
Download
Plain Diff
Bug#14096619: UNABLE TO RESTORE DATABASE DUMP
Backport of fix for Bug#13581962
parents
f693203e
082ac987
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
8 deletions
+75
-8
mysql-test/r/cast.result
mysql-test/r/cast.result
+18
-0
mysql-test/r/ctype_utf8mb4.result
mysql-test/r/ctype_utf8mb4.result
+18
-0
mysql-test/t/cast.test
mysql-test/t/cast.test
+13
-0
mysql-test/t/ctype_utf8mb4.test
mysql-test/t/ctype_utf8mb4.test
+15
-0
sql/item_func.h
sql/item_func.h
+11
-8
No files found.
mysql-test/r/cast.result
View file @
2b4a942a
...
@@ -477,4 +477,22 @@ WHERE CAST(a as BINARY)=x'62736D697468'
...
@@ -477,4 +477,22 @@ WHERE CAST(a as BINARY)=x'62736D697468'
AND CAST(a AS BINARY)=x'65736D697468';
AND CAST(a AS BINARY)=x'65736D697468';
a
a
DROP TABLE t1;
DROP TABLE t1;
#
# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
# LONGTEXT, UNION, USER VARIABLE
# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
#
CREATE TABLE t1 AS SELECT CONCAT(CAST(REPEAT('9', 1000) AS SIGNED)),
CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED));
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'
Warning 1292 Truncated incorrect INTEGER value: '99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL DEFAULT '',
`CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
# End of test for Bug#13581962, Bug#14096619
End of 5.1 tests
End of 5.1 tests
mysql-test/r/ctype_utf8mb4.result
View file @
2b4a942a
...
@@ -2539,6 +2539,24 @@ t2 CREATE TABLE `t2` (
...
@@ -2539,6 +2539,24 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
DROP TABLE t1, t2;
#
#
# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
# LONGTEXT, UNION, USER VARIABLE
# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
#
CREATE TABLE t1(f1 LONGTEXT CHARACTER SET utf8mb4);
INSERT INTO t1 VALUES ('a');
SELECT @a:= CAST(f1 AS SIGNED) FROM t1
UNION ALL
SELECT CAST(f1 AS SIGNED) FROM t1;
@a:= CAST(f1 AS SIGNED)
0
0
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'a'
Warning 1292 Truncated incorrect INTEGER value: 'a'
DROP TABLE t1;
# End of test for Bug#13581962,Bug#14096619
#
# End of 5.5 tests
# End of 5.5 tests
#
#
#
#
...
...
mysql-test/t/cast.test
View file @
2b4a942a
...
@@ -307,4 +307,17 @@ WHERE CAST(a as BINARY)=x'62736D697468'
...
@@ -307,4 +307,17 @@ WHERE CAST(a as BINARY)=x'62736D697468'
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
--
echo
# LONGTEXT, UNION, USER VARIABLE
--
echo
# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
--
echo
#
CREATE
TABLE
t1
AS
SELECT
CONCAT
(
CAST
(
REPEAT
(
'9'
,
1000
)
AS
SIGNED
)),
CONCAT
(
CAST
(
REPEAT
(
'9'
,
1000
)
AS
UNSIGNED
));
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
# End of test for Bug#13581962, Bug#14096619
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
mysql-test/t/ctype_utf8mb4.test
View file @
2b4a942a
...
@@ -1811,6 +1811,21 @@ CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1;
...
@@ -1811,6 +1811,21 @@ CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1;
SHOW
CREATE
TABLE
t2
;
SHOW
CREATE
TABLE
t2
;
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# Bug#13581962 HIGH MEMORY USAGE ATTEMPT, THEN CRASH WITH
--
echo
# LONGTEXT, UNION, USER VARIABLE
--
echo
# Bug#14096619 UNABLE TO RESTORE DATABASE DUMP
--
echo
#
CREATE
TABLE
t1
(
f1
LONGTEXT
CHARACTER
SET
utf8mb4
);
INSERT
INTO
t1
VALUES
(
'a'
);
SELECT
@
a
:=
CAST
(
f1
AS
SIGNED
)
FROM
t1
UNION
ALL
SELECT
CAST
(
f1
AS
SIGNED
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
# End of test for Bug#13581962,Bug#14096619
--
echo
#
--
echo
#
--
echo
# End of 5.5 tests
--
echo
# End of 5.5 tests
--
echo
#
--
echo
#
...
...
sql/item_func.h
View file @
2b4a942a
...
@@ -480,12 +480,18 @@ public:
...
@@ -480,12 +480,18 @@ public:
class
Item_func_signed
:
public
Item_int_func
class
Item_func_signed
:
public
Item_int_func
{
{
public:
public:
Item_func_signed
(
Item
*
a
)
:
Item_int_func
(
a
)
{}
Item_func_signed
(
Item
*
a
)
:
Item_int_func
(
a
)
{
unsigned_flag
=
0
;
}
const
char
*
func_name
()
const
{
return
"cast_as_signed"
;
}
const
char
*
func_name
()
const
{
return
"cast_as_signed"
;
}
longlong
val_int
();
longlong
val_int
();
longlong
val_int_from_str
(
int
*
error
);
longlong
val_int_from_str
(
int
*
error
);
void
fix_length_and_dec
()
void
fix_length_and_dec
()
{
fix_char_length
(
args
[
0
]
->
max_char_length
());
unsigned_flag
=
0
;
}
{
fix_char_length
(
min
(
args
[
0
]
->
max_char_length
(),
MY_INT64_NUM_DECIMAL_DIGITS
));
}
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
uint
decimal_precision
()
const
{
return
args
[
0
]
->
decimal_precision
();
}
uint
decimal_precision
()
const
{
return
args
[
0
]
->
decimal_precision
();
}
};
};
...
@@ -494,14 +500,11 @@ public:
...
@@ -494,14 +500,11 @@ public:
class
Item_func_unsigned
:
public
Item_func_signed
class
Item_func_unsigned
:
public
Item_func_signed
{
{
public:
public:
Item_func_unsigned
(
Item
*
a
)
:
Item_func_signed
(
a
)
{}
Item_func_unsigned
(
Item
*
a
)
:
Item_func_signed
(
a
)
const
char
*
func_name
()
const
{
return
"cast_as_unsigned"
;
}
void
fix_length_and_dec
()
{
{
fix_char_length
(
min
(
args
[
0
]
->
max_char_length
(),
unsigned_flag
=
1
;
DECIMAL_MAX_PRECISION
+
2
));
unsigned_flag
=
1
;
}
}
const
char
*
func_name
()
const
{
return
"cast_as_unsigned"
;
}
longlong
val_int
();
longlong
val_int
();
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
virtual
void
print
(
String
*
str
,
enum_query_type
query_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