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
8abb85a1
Commit
8abb85a1
authored
Jan 07, 2005
by
paul@kite-hub.kitebird.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge kite-hub.kitebird.com:/src/extern/MySQL/bk/mysql-4.1
into kite-hub.kitebird.com:/src/extern/MySQL/bk/merge-5.0
parents
52ebc04f
c2eb3bf9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
34 deletions
+84
-34
mysql-test/r/type_float.result
mysql-test/r/type_float.result
+36
-0
mysql-test/r/type_float.result.es
mysql-test/r/type_float.result.es
+36
-0
mysql-test/t/type_float.test
mysql-test/t/type_float.test
+10
-0
sql/field.cc
sql/field.cc
+2
-34
No files found.
mysql-test/r/type_float.result
View file @
8abb85a1
...
...
@@ -143,3 +143,39 @@ drop table t1;
create table t1 (f float(54));
ERROR 42000: Incorrect column specifier for column 'f'
drop table if exists t1;
create table t1 (f float(4,3));
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
Warnings:
Warning 1264 Data truncated; out of range for column 'f' at row 1
Warning 1264 Data truncated; out of range for column 'f' at row 2
Warning 1264 Data truncated; out of range for column 'f' at row 3
Warning 1264 Data truncated; out of range for column 'f' at row 4
Warning 1264 Data truncated; out of range for column 'f' at row 5
Warning 1264 Data truncated; out of range for column 'f' at row 6
select * from t1;
f
-9.999
-9.999
-9.999
9.999
9.999
9.999
drop table if exists t1;
create table t1 (f double(4,3));
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
Warnings:
Warning 1264 Data truncated; out of range for column 'f' at row 1
Warning 1264 Data truncated; out of range for column 'f' at row 2
Warning 1264 Data truncated; out of range for column 'f' at row 3
Warning 1264 Data truncated; out of range for column 'f' at row 4
Warning 1264 Data truncated; out of range for column 'f' at row 5
Warning 1264 Data truncated; out of range for column 'f' at row 6
select * from t1;
f
-9.999
-9.999
-9.999
9.999
9.999
9.999
drop table if exists t1;
mysql-test/r/type_float.result.es
View file @
8abb85a1
...
...
@@ -143,3 +143,39 @@ drop table t1;
create table t1 (f float(54));
ERROR 42000: Incorrect column specifier for column 'f'
drop table if exists t1;
create table t1 (f float(4,3));
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
Warnings:
Warning 1264 Data truncated; out of range for column 'f' at row 1
Warning 1264 Data truncated; out of range for column 'f' at row 2
Warning 1264 Data truncated; out of range for column 'f' at row 3
Warning 1264 Data truncated; out of range for column 'f' at row 4
Warning 1264 Data truncated; out of range for column 'f' at row 5
Warning 1264 Data truncated; out of range for column 'f' at row 6
select * from t1;
f
-9.999
-9.999
-9.999
9.999
9.999
9.999
drop table if exists t1;
create table t1 (f double(4,3));
insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11");
Warnings:
Warning 1264 Data truncated; out of range for column 'f' at row 1
Warning 1264 Data truncated; out of range for column 'f' at row 2
Warning 1264 Data truncated; out of range for column 'f' at row 3
Warning 1264 Data truncated; out of range for column 'f' at row 4
Warning 1264 Data truncated; out of range for column 'f' at row 5
Warning 1264 Data truncated; out of range for column 'f' at row 6
select * from t1;
f
-9.999
-9.999
-9.999
9.999
9.999
9.999
drop table if exists t1;
mysql-test/t/type_float.test
View file @
8abb85a1
...
...
@@ -93,3 +93,13 @@ create table t1 (f float(54)); # Should give an error
drop
table
if
exists
t1
;
--
enable_warnings
# Ensure that maximum values as the result of number of decimals
# being specified in table schema are enforced (Bug #7361)
create
table
t1
(
f
float
(
4
,
3
));
insert
into
t1
values
(
-
11.0
),(
-
11
),(
"-11"
),(
11.0
),(
11
),(
"11"
);
select
*
from
t1
;
drop
table
if
exists
t1
;
create
table
t1
(
f
double
(
4
,
3
));
insert
into
t1
values
(
-
11.0
),(
-
11
),(
"-11"
),(
11.0
),(
11
),(
"11"
);
select
*
from
t1
;
drop
table
if
exists
t1
;
sql/field.cc
View file @
8abb85a1
...
...
@@ -2440,23 +2440,7 @@ int Field_float::store(double nr)
int
Field_float
::
store
(
longlong
nr
)
{
int
error
=
0
;
float
j
=
(
float
)
nr
;
if
(
unsigned_flag
&&
j
<
0
)
{
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_OUT_OF_RANGE
,
1
);
j
=
0
;
error
=
1
;
}
#ifdef WORDS_BIGENDIAN
if
(
table
->
db_low_byte_first
)
{
float4store
(
ptr
,
j
);
}
else
#endif
memcpy_fixed
(
ptr
,(
byte
*
)
&
j
,
sizeof
(
j
));
return
error
;
return
store
((
double
)
nr
);
}
...
...
@@ -2738,23 +2722,7 @@ int Field_double::store(double nr)
int
Field_double
::
store
(
longlong
nr
)
{
double
j
=
(
double
)
nr
;
int
error
=
0
;
if
(
unsigned_flag
&&
j
<
0
)
{
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_OUT_OF_RANGE
,
1
);
error
=
1
;
j
=
0
;
}
#ifdef WORDS_BIGENDIAN
if
(
table
->
db_low_byte_first
)
{
float8store
(
ptr
,
j
);
}
else
#endif
doublestore
(
ptr
,
j
);
return
error
;
return
store
((
double
)
nr
);
}
...
...
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