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
e1f93509
Commit
e1f93509
authored
Dec 12, 2008
by
Gleb Shchepa
Browse files
Options
Browse Files
Download
Plain Diff
auto merge 5.0-bugteam --> 5.1-bugteam (bug 40761)
parents
5772a50b
c1bf0475
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
mysql-test/r/func_if.result
mysql-test/r/func_if.result
+9
-0
mysql-test/t/func_if.test
mysql-test/t/func_if.test
+14
-0
sql/item_func.h
sql/item_func.h
+4
-1
No files found.
mysql-test/r/func_if.result
View file @
e1f93509
...
...
@@ -176,4 +176,13 @@ IF((ROUND(t1.a,2)=1), 2,
IF((ROUND(t1.a,2)=1), 2,
IF((R
DROP TABLE t1;
CREATE TABLE t1 (c LONGTEXT);
INSERT INTO t1 VALUES(1), (2), (3), (4), ('12345678901234567890');
SELECT * FROM (SELECT MAX(IF(1, CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
MAX(IF(1, CAST(c AS UNSIGNED), 0))
12345678901234567890
SELECT * FROM (SELECT MAX(IFNULL(CAST(c AS UNSIGNED), 0)) FROM t1) AS te;
MAX(IFNULL(CAST(c AS UNSIGNED), 0))
12345678901234567890
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/func_if.test
View file @
e1f93509
...
...
@@ -150,4 +150,18 @@ FROM t1;
DROP
TABLE
t1
;
#
# Bug #40761: Assert on sum func on IF(..., CAST(longtext AS UNSIGNED), signed)
# (was: LEFT JOIN on inline view crashes server)
#
CREATE
TABLE
t1
(
c
LONGTEXT
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
),
(
4
),
(
'12345678901234567890'
);
SELECT
*
FROM
(
SELECT
MAX
(
IF
(
1
,
CAST
(
c
AS
UNSIGNED
),
0
))
FROM
t1
)
AS
te
;
SELECT
*
FROM
(
SELECT
MAX
(
IFNULL
(
CAST
(
c
AS
UNSIGNED
),
0
))
FROM
t1
)
AS
te
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/item_func.h
View file @
e1f93509
...
...
@@ -362,7 +362,10 @@ public:
Item_func_unsigned
(
Item
*
a
)
:
Item_func_signed
(
a
)
{}
const
char
*
func_name
()
const
{
return
"cast_as_unsigned"
;
}
void
fix_length_and_dec
()
{
max_length
=
args
[
0
]
->
max_length
;
unsigned_flag
=
1
;
}
{
max_length
=
min
(
args
[
0
]
->
max_length
,
DECIMAL_MAX_PRECISION
+
2
);
unsigned_flag
=
1
;
}
longlong
val_int
();
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