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
e2288f9a
Commit
e2288f9a
authored
Oct 10, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/bkroot/mysql-4.1-rpl
into mysql.com:/home/bk/MERGE/mysql-4.1-merge
parents
44253ab7
f097517d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
7 deletions
+38
-7
mysql-test/r/cast.result
mysql-test/r/cast.result
+3
-0
mysql-test/r/ps.result
mysql-test/r/ps.result
+7
-7
mysql-test/t/cast.test
mysql-test/t/cast.test
+6
-0
mysql-test/t/count_distinct3.test
mysql-test/t/count_distinct3.test
+2
-0
sql/item_func.cc
sql/item_func.cc
+20
-0
No files found.
mysql-test/r/cast.result
View file @
e2288f9a
...
@@ -264,6 +264,9 @@ cast(repeat('1',20) as signed)
...
@@ -264,6 +264,9 @@ cast(repeat('1',20) as signed)
-7335632962598440505
-7335632962598440505
Warnings:
Warnings:
Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement
Warning 1105 Cast to signed converted positive out-of-range integer to it's negative complement
select cast(19999999999999999999 as unsigned);
cast(19999999999999999999 as unsigned)
18446744073709551615
select cast(1.0e+300 as signed int);
select cast(1.0e+300 as signed int);
cast(1.0e+300 as signed int)
cast(1.0e+300 as signed int)
9223372036854775807
9223372036854775807
...
...
mysql-test/r/ps.result
View file @
e2288f9a
...
@@ -340,7 +340,7 @@ set @precision=10000000000;
...
@@ -340,7 +340,7 @@ set @precision=10000000000;
select rand(),
select rand(),
cast(rand(10)*@precision as unsigned integer) from t1;
cast(rand(10)*@precision as unsigned integer) from t1;
rand() cast(rand(10)*@precision as unsigned integer)
rand() cast(rand(10)*@precision as unsigned integer)
- 65705152
19
- 65705152
20
- 1282061302
- 1282061302
- 6698761160
- 6698761160
- 9647622201
- 9647622201
...
@@ -351,23 +351,23 @@ prepare stmt from
...
@@ -351,23 +351,23 @@ prepare stmt from
set @var=1;
set @var=1;
execute stmt using @var;
execute stmt using @var;
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
- 65705152
19
-
- 65705152
20
-
- 1282061302 -
- 1282061302 -
- 6698761160 -
- 6698761160 -
- 9647622201 -
- 9647622201 -
set @var=2;
set @var=2;
execute stmt using @var;
execute stmt using @var;
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
- 65705152
19
6555866465
- 65705152
20
6555866465
- 1282061302 122346619
2
- 1282061302 122346619
3
- 6698761160 644973187
3
- 6698761160 644973187
4
- 9647622201 8578261098
- 9647622201 8578261098
set @var=3;
set @var=3;
execute stmt using @var;
execute stmt using @var;
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
- 65705152
19 9057697559
- 65705152
20 9057697560
- 1282061302 3730790581
- 1282061302 3730790581
- 6698761160 148086053
4
- 6698761160 148086053
5
- 9647622201 6211931236
- 9647622201 6211931236
drop table t1;
drop table t1;
deallocate prepare stmt;
deallocate prepare stmt;
...
...
mysql-test/t/cast.test
View file @
e2288f9a
...
@@ -147,6 +147,12 @@ select cast(concat('184467440','73709551615') as signed);
...
@@ -147,6 +147,12 @@ select cast(concat('184467440','73709551615') as signed);
select
cast
(
repeat
(
'1'
,
20
)
as
unsigned
);
select
cast
(
repeat
(
'1'
,
20
)
as
unsigned
);
select
cast
(
repeat
(
'1'
,
20
)
as
signed
);
select
cast
(
repeat
(
'1'
,
20
)
as
signed
);
#
# Bug#8663 cant use bgint unsigned as input to cast
#
select
cast
(
19999999999999999999
as
unsigned
);
#
#
# Bug #13344: cast of large decimal to signed int not handled correctly
# Bug #13344: cast of large decimal to signed int not handled correctly
#
#
...
...
mysql-test/t/count_distinct3.test
View file @
e2288f9a
...
@@ -9,6 +9,7 @@ DROP TABLE IF EXISTS t1, t2;
...
@@ -9,6 +9,7 @@ DROP TABLE IF EXISTS t1, t2;
CREATE
TABLE
t1
(
id
INTEGER
,
grp
TINYINT
,
id_rev
INTEGER
);
CREATE
TABLE
t1
(
id
INTEGER
,
grp
TINYINT
,
id_rev
INTEGER
);
--
disable_warnings
--
disable_query_log
--
disable_query_log
SET
@
rnd_max
=
2147483647
;
SET
@
rnd_max
=
2147483647
;
let
$
1
=
1000
;
let
$
1
=
1000
;
...
@@ -43,6 +44,7 @@ INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
...
@@ -43,6 +44,7 @@ INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
INSERT
INTO
t2
(
id
,
grp
,
id_rev
)
SELECT
id
,
grp
,
id_rev
FROM
t1
;
DROP
TABLE
t2
;
DROP
TABLE
t2
;
--
enable_query_log
--
enable_query_log
--
enable_warnings
SELECT
COUNT
(
*
)
FROM
t1
;
SELECT
COUNT
(
*
)
FROM
t1
;
...
...
sql/item_func.cc
View file @
e2288f9a
...
@@ -508,6 +508,26 @@ longlong Item_func_unsigned::val_int()
...
@@ -508,6 +508,26 @@ longlong Item_func_unsigned::val_int()
longlong
value
;
longlong
value
;
int
error
;
int
error
;
if
(
args
[
0
]
->
result_type
()
==
REAL_RESULT
)
{
double
dvalue
=
args
[
0
]
->
val
();
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
if
(
dvalue
<=
(
double
)
LONGLONG_MIN
)
{
return
LONGLONG_MIN
;
}
if
(
dvalue
>=
(
double
)
(
ulonglong
)
ULONGLONG_MAX
)
{
return
(
longlong
)
ULONGLONG_MAX
;
}
if
(
dvalue
>=
(
double
)
(
ulonglong
)
LONGLONG_MAX
)
{
return
(
ulonglong
)
(
dvalue
+
(
dvalue
>
0
?
0.5
:
-
0.5
));
}
return
(
longlong
)
(
dvalue
+
(
dvalue
>
0
?
0.5
:
-
0.5
));
}
if
(
args
[
0
]
->
cast_to_int_type
()
!=
STRING_RESULT
)
if
(
args
[
0
]
->
cast_to_int_type
()
!=
STRING_RESULT
)
{
{
value
=
args
[
0
]
->
val_int
();
value
=
args
[
0
]
->
val_int
();
...
...
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