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
4ab6313b
Commit
4ab6313b
authored
Mar 28, 2011
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.1 -> 5.5 merge
parents
b1b17093
a88faf2a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
3 deletions
+50
-3
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+7
-0
mysql-test/r/variables.result
mysql-test/r/variables.result
+16
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+9
-0
mysql-test/t/variables.test
mysql-test/t/variables.test
+13
-0
sql/item_func.cc
sql/item_func.cc
+5
-3
No files found.
mysql-test/r/func_math.result
View file @
4ab6313b
...
...
@@ -514,6 +514,13 @@ t1 CREATE TABLE `t1` (
`C` varchar(23) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR
#
CREATE TABLE t1 SELECT CEIL(LINESTRINGFROMWKB(1) DIV NULL);
DROP TABLE t1;
CREATE TABLE t1 SELECT FLOOR(LINESTRINGFROMWKB(1) DIV NULL);
DROP TABLE t1;
End of 5.1 tests
#
# Bug #8433: Overflow must be an error
...
...
mysql-test/r/variables.result
View file @
4ab6313b
...
...
@@ -1546,6 +1546,22 @@ Warning 1292 Truncated incorrect key_cache_block_size value: '0'
select @@max_long_data_size;
@@max_long_data_size
1048576
#
# Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE
#
CREATE TABLE t1(f1 DECIMAL(1,1) UNSIGNED);
INSERT INTO t1 VALUES (0.2),(0.1);
SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1);
1
1
DROP TABLE t1;
CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(1) unsigned NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET @@global.max_binlog_cache_size=DEFAULT;
SET @@global.max_join_size=DEFAULT;
SET @@global.key_buffer_size=@kbs;
...
...
mysql-test/t/func_math.test
View file @
4ab6313b
...
...
@@ -345,6 +345,15 @@ CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#11764994 57900: CREATE TABLE .. SELECT ASSERTS SCALE >= 0 && PRECISION > 0 && SCALE <= PR
--
echo
#
CREATE
TABLE
t1
SELECT
CEIL
(
LINESTRINGFROMWKB
(
1
)
DIV
NULL
);
DROP
TABLE
t1
;
CREATE
TABLE
t1
SELECT
FLOOR
(
LINESTRINGFROMWKB
(
1
)
DIV
NULL
);
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
--
echo
#
...
...
mysql-test/t/variables.test
View file @
4ab6313b
...
...
@@ -1286,6 +1286,19 @@ SET @@global.key_cache_block_size=0;
#
select
@@
max_long_data_size
;
--
echo
#
--
echo
# Bug#11766424 59527: DECIMAL_BIN_SIZE: ASSERTION `SCALE >= 0 && PRECISION > 0 && SCALE <= PRE
--
echo
#
CREATE
TABLE
t1
(
f1
DECIMAL
(
1
,
1
)
UNSIGNED
);
INSERT
INTO
t1
VALUES
(
0.2
),(
0.1
);
SELECT
1
FROM
t1
GROUP
BY
@
a
:=
(
SELECT
ROUND
(
f1
)
FROM
t1
WHERE
@
a
=
f1
);
DROP
TABLE
t1
;
CREATE
TABLE
t1
AS
SELECT
@
a
:=
CAST
(
1
AS
UNSIGNED
)
AS
a
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
# cleanup
SET
@@
global
.
max_binlog_cache_size
=
DEFAULT
;
SET
@@
global
.
max_join_size
=
DEFAULT
;
...
...
sql/item_func.cc
View file @
4ab6313b
...
...
@@ -2088,9 +2088,10 @@ void Item_func_integer::fix_length_and_dec()
void
Item_func_int_val
::
fix_num_length_and_dec
()
{
max_length
=
args
[
0
]
->
max_length
-
(
args
[
0
]
->
decimals
?
args
[
0
]
->
decimals
+
1
:
0
)
+
2
;
ulonglong
tmp_max_length
=
(
ulonglong
)
args
[
0
]
->
max_length
-
(
args
[
0
]
->
decimals
?
args
[
0
]
->
decimals
+
1
:
0
)
+
2
;
max_length
=
tmp_max_length
>
(
ulonglong
)
4294967295U
?
(
uint32
)
4294967295U
:
(
uint32
)
tmp_max_length
;
uint
tmp
=
float_length
(
decimals
);
set_if_smaller
(
max_length
,
tmp
);
decimals
=
0
;
...
...
@@ -4261,6 +4262,7 @@ Item_func_set_user_var::fix_length_and_dec()
fix_length_and_charset
(
args
[
0
]
->
max_char_length
(),
args
[
0
]
->
collation
.
collation
);
}
unsigned_flag
=
args
[
0
]
->
unsigned_flag
;
}
...
...
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