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
e773a26e
Commit
e773a26e
authored
22 years ago
by
peter@linux.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding handling of numbers with exponent to decimal type.
parent
1d074b3d
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
362 additions
and
129 deletions
+362
-129
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+40
-0
mysql-test/t/type_decimal.test
mysql-test/t/type_decimal.test
+8
-0
sql/field.cc
sql/field.cc
+314
-129
No files found.
mysql-test/r/type_decimal.result
View file @
e773a26e
...
@@ -156,6 +156,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
...
@@ -156,6 +156,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
select * from t1;
a
a
0.00
0.00
...
@@ -176,6 +178,14 @@ a
...
@@ -176,6 +178,14 @@ a
-99999999.99
-99999999.99
999999999.99
999999999.99
999999999.99
999999999.99
999999999.99
0.00
-99999999.99
123.40
12340.00
1.23
1230.00
123.00
drop table t1;
drop table t1;
create table t1 (a decimal(10,2) unsigned);
create table t1 (a decimal(10,2) unsigned);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
...
@@ -183,6 +193,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
...
@@ -183,6 +193,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
select * from t1;
a
a
0.00
0.00
...
@@ -203,6 +215,14 @@ a
...
@@ -203,6 +215,14 @@ a
0.00
0.00
99999999.99
99999999.99
99999999.99
99999999.99
99999999.99
0.00
0.00
123.40
12340.00
1.23
1230.00
123.00
drop table t1;
drop table t1;
create table t1 (a decimal(10,2) zerofill);
create table t1 (a decimal(10,2) zerofill);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
...
@@ -210,6 +230,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
...
@@ -210,6 +230,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
select * from t1;
select * from t1;
a
a
00000000.00
00000000.00
...
@@ -230,6 +252,14 @@ a
...
@@ -230,6 +252,14 @@ a
00000000.00
00000000.00
99999999.99
99999999.99
99999999.99
99999999.99
99999999.99
00000000.00
00000000.00
00000123.40
00012340.00
00000001.23
00001230.00
00000123.00
drop table t1;
drop table t1;
create table t1 (a decimal(10,2));
create table t1 (a decimal(10,2));
insert into t1 values (0.0),("-0.0"),(+0.0),(01.0),(+01.0),(-01.0);
insert into t1 values (0.0),("-0.0"),(+0.0),(01.0),(+01.0),(-01.0);
...
@@ -237,6 +267,8 @@ insert into t1 values (-.1),(+.1),(.1);
...
@@ -237,6 +267,8 @@ insert into t1 values (-.1),(+.1),(.1);
insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11);
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11);
insert into t1 values (1e+1000),(1e-1000),(-1e+1000);
insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
select * from t1;
select * from t1;
a
a
0.00
0.00
...
@@ -257,6 +289,14 @@ a
...
@@ -257,6 +289,14 @@ a
-99999999.99
-99999999.99
999999999.99
999999999.99
999999999.99
999999999.99
999999999.99
0.00
-99999999.99
123.40
12340.00
1.23
1230.00
123.00
drop table t1;
drop table t1;
create table t1 (a decimal);
create table t1 (a decimal);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
...
...
This diff is collapsed.
Click to expand it.
mysql-test/t/type_decimal.test
View file @
e773a26e
...
@@ -160,6 +160,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
...
@@ -160,6 +160,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.11"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.11"
);
insert
into
t1
values
(
"-111111111.11"
),(
"+1111111111.11"
),(
"1111111111.11"
);
insert
into
t1
values
(
"-111111111.11"
),(
"+1111111111.11"
),(
"1111111111.11"
);
insert
into
t1
values
(
"1e+1000"
),(
"1e-1000"
),(
"-1e+1000"
);
insert
into
t1
values
(
"123.4e"
),(
"123.4e+2"
),(
"123.4e-2"
),(
"123e1"
),(
"123e+0"
);
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
...
@@ -169,6 +171,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
...
@@ -169,6 +171,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.11"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.11"
);
insert
into
t1
values
(
"-111111111.11"
),(
"+1111111111.11"
),(
"1111111111.11"
);
insert
into
t1
values
(
"-111111111.11"
),(
"+1111111111.11"
),(
"1111111111.11"
);
insert
into
t1
values
(
"1e+1000"
),(
"1e-1000"
),(
"-1e+1000"
);
insert
into
t1
values
(
"123.4e"
),(
"123.4e+2"
),(
"123.4e-2"
),(
"123e1"
),(
"123e+0"
);
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
...
@@ -178,6 +182,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
...
@@ -178,6 +182,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.11"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.11"
);
insert
into
t1
values
(
"-111111111.11"
),(
"+1111111111.11"
),(
"1111111111.11"
);
insert
into
t1
values
(
"-111111111.11"
),(
"+1111111111.11"
),(
"1111111111.11"
);
insert
into
t1
values
(
"1e+1000"
),(
"1e-1000"
),(
"-1e+1000"
);
insert
into
t1
values
(
"123.4e"
),(
"123.4e+2"
),(
"123.4e-2"
),(
"123e1"
),(
"123e+0"
);
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
...
@@ -189,6 +195,8 @@ insert into t1 values (-.1),(+.1),(.1);
...
@@ -189,6 +195,8 @@ insert into t1 values (-.1),(+.1),(.1);
insert
into
t1
values
(
00000000000001
),(
+
0000000000001
),(
-
0000000000001
);
insert
into
t1
values
(
00000000000001
),(
+
0000000000001
),(
-
0000000000001
);
insert
into
t1
values
(
+
111111111.11
),(
111111111.11
),(
-
11111111.11
);
insert
into
t1
values
(
+
111111111.11
),(
111111111.11
),(
-
11111111.11
);
insert
into
t1
values
(
-
111111111.11
),(
+
1111111111.11
),(
1111111111.11
);
insert
into
t1
values
(
-
111111111.11
),(
+
1111111111.11
),(
1111111111.11
);
insert
into
t1
values
(
1
e
+
1000
),(
1
e
-
1000
),(
-
1
e
+
1000
);
insert
into
t1
values
(
123.4e0
),(
123.4e+2
),(
123.4e-2
),(
123
e1
),(
123
e
+
0
);
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
...
...
This diff is collapsed.
Click to expand it.
sql/field.cc
View file @
e773a26e
This diff is collapsed.
Click to expand it.
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