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
1bd2beff
Commit
1bd2beff
authored
Sep 21, 2005
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure that hex strings are used as integers in cast(... signed/unsigned)
This fixes the new report for bug #7036
parent
21636f1c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
mysql-test/t/cast.test
mysql-test/t/cast.test
+4
-0
sql/item.h
sql/item.h
+1
-0
No files found.
mysql-test/t/cast.test
View file @
1bd2beff
...
@@ -20,6 +20,10 @@ select CONVERT(DATE "2004-01-22 21:45:33",CHAR);
...
@@ -20,6 +20,10 @@ select CONVERT(DATE "2004-01-22 21:45:33",CHAR);
select
CONVERT
(
DATE
"2004-01-22 21:45:33"
,
CHAR
(
4
));
select
CONVERT
(
DATE
"2004-01-22 21:45:33"
,
CHAR
(
4
));
select
CONVERT
(
DATE
"2004-01-22 21:45:33"
,
BINARY
(
4
));
select
CONVERT
(
DATE
"2004-01-22 21:45:33"
,
BINARY
(
4
));
select
CAST
(
DATE
"2004-01-22 21:45:33"
AS
BINARY
(
4
));
select
CAST
(
DATE
"2004-01-22 21:45:33"
AS
BINARY
(
4
));
select
CAST
(
0xb3
as
signed
);
select
CAST
(
0x8fffffffffffffff
as
signed
);
select
CAST
(
0xffffffffffffffff
as
unsigned
);
select
CAST
(
0xfffffffffffffffe
as
signed
);
# out-of-range cases
# out-of-range cases
select
cast
(
'18446744073709551616'
as
unsigned
);
select
cast
(
'18446744073709551616'
as
unsigned
);
...
...
sql/item.h
View file @
1bd2beff
...
@@ -842,6 +842,7 @@ public:
...
@@ -842,6 +842,7 @@ public:
String
*
val_str
(
String
*
)
{
DBUG_ASSERT
(
fixed
==
1
);
return
&
str_value
;
}
String
*
val_str
(
String
*
)
{
DBUG_ASSERT
(
fixed
==
1
);
return
&
str_value
;
}
int
save_in_field
(
Field
*
field
,
bool
no_conversions
);
int
save_in_field
(
Field
*
field
,
bool
no_conversions
);
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum
Item_result
cast_to_int_type
()
const
{
return
INT_RESULT
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_STRING
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_STRING
;
}
// to prevent drop fixed flag (no need parent cleanup call)
// to prevent drop fixed flag (no need parent cleanup call)
void
cleanup
()
{}
void
cleanup
()
{}
...
...
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