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
ee8c7a3e
Commit
ee8c7a3e
authored
Feb 22, 2005
by
monty@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
After merge fixes
parent
65b37a04
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
mysql-test/r/strict.result
mysql-test/r/strict.result
+7
-5
mysql-test/t/strict.test
mysql-test/t/strict.test
+2
-2
sql/item_sum.h
sql/item_sum.h
+10
-4
No files found.
mysql-test/r/strict.result
View file @
ee8c7a3e
...
...
@@ -852,8 +852,8 @@ NULL NULL
3.40282e+38 0
DROP TABLE t1;
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED);
INSERT INTO t1 VALUES (-2.2E-307,0),(+1.7E+308,+1.7E+308);
INSERT INTO t1 VALUES ('-2.2E-307',0),('+1.7E+308','+1.7E+308');
INSERT INTO t1 VALUES (-2.2E-307,0),(
2E-307,0),(
+1.7E+308,+1.7E+308);
INSERT INTO t1 VALUES ('-2.2E-307',0),('
-2E-307',0),('
+1.7E+308','+1.7E+308');
INSERT INTO t1 (col1) VALUES (-2.2E-330);
INSERT INTO t1 (col1) VALUES (+1.7E+309);
Got one of the listed errors
...
...
@@ -864,7 +864,7 @@ ERROR 22003: Out of range value adjusted for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
ERROR 22003: Out of range value adjusted for column 'col2' at row 1
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
ERROR 22003: Out of range value adjusted for column 'col1' at row
2
ERROR 22003: Out of range value adjusted for column 'col1' at row
3
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
...
...
@@ -890,9 +890,11 @@ Warning 1264 Out of range value adjusted for column 'col2' at row 1
Warning 1264 Out of range value adjusted for column 'col2' at row 1
SELECT * FROM t1;
col1 col2
-2.2e-307 0
0 0
1e-303 0
1.7e+308 1.7e+308
-2.2e-307 0
0 0
-2e-307 0
1.7e+308 1.7e+308
0 NULL
2 NULL
...
...
mysql-test/t/strict.test
View file @
ee8c7a3e
...
...
@@ -828,8 +828,8 @@ DROP TABLE t1;
# Test INSERT with DOUBLE
CREATE
TABLE
t1
(
col1
DOUBLE
PRECISION
,
col2
DOUBLE
PRECISION
UNSIGNED
);
INSERT
INTO
t1
VALUES
(
-
2.2E-307
,
0
),(
+
1.7E+308
,
+
1.7E+308
);
INSERT
INTO
t1
VALUES
(
'-2.2E-307'
,
0
),(
'+1.7E+308'
,
'+1.7E+308'
);
INSERT
INTO
t1
VALUES
(
-
2.2E-307
,
0
),(
2
E
-
307
,
0
),(
+
1.7E+308
,
+
1.7E+308
);
INSERT
INTO
t1
VALUES
(
'-2.2E-307'
,
0
),(
'
-2E-307'
,
0
),(
'
+1.7E+308'
,
'+1.7E+308'
);
# We don't give warnings for underflow
INSERT
INTO
t1
(
col1
)
VALUES
(
-
2.2E-330
);
--
error
1367
,
1264
...
...
sql/item_sum.h
View file @
ee8c7a3e
...
...
@@ -691,7 +691,6 @@ class Item_sum_udf_str :public Item_udf_sum
{
int
err_not_used
;
char
*
end_not_used
;
char
*
end_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntod
(
res
->
charset
(),(
char
*
)
res
->
ptr
(),
res
->
length
(),
...
...
@@ -700,9 +699,16 @@ class Item_sum_udf_str :public Item_udf_sum
longlong
val_int
()
{
int
err_not_used
;
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
10
,
(
char
**
)
0
,
&
err_not_used
)
:
(
longlong
)
0
;
char
*
end
;
String
*
res
;
longlong
value
;
CHARSET_INFO
*
cs
;
if
(
!
(
res
=
val_str
(
&
str_value
)))
return
0
;
/* Null value */
cs
=
res
->
charset
();
end
=
(
char
*
)
res
->
ptr
()
+
res
->
length
();
return
cs
->
cset
->
my_strtoll10
(
cs
,
res
->
ptr
(),
&
end
,
&
err_not_used
);
}
my_decimal
*
val_decimal
(
my_decimal
*
dec
);
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
...
...
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