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
e773a26e
Commit
e773a26e
authored
Jun 24, 2002
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");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.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;
a
0.00
...
...
@@ -176,6 +178,14 @@ a
-99999999.99
999999999.99
999999999.99
999999999.99
0.00
-99999999.99
123.40
12340.00
1.23
1230.00
123.00
drop table t1;
create table t1 (a decimal(10,2) unsigned);
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");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.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;
a
0.00
...
...
@@ -203,6 +215,14 @@ a
0.00
99999999.99
99999999.99
99999999.99
0.00
0.00
123.40
12340.00
1.23
1230.00
123.00
drop table t1;
create table t1 (a decimal(10,2) zerofill);
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");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.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;
a
00000000.00
...
...
@@ -230,6 +252,14 @@ a
00000000.00
99999999.99
99999999.99
99999999.99
00000000.00
00000000.00
00000123.40
00012340.00
00000001.23
00001230.00
00000123.00
drop table t1;
create table t1 (a decimal(10,2));
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);
insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
insert into t1 values (+111111111.11),(111111111.11),(-11111111.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;
a
0.00
...
...
@@ -257,6 +289,14 @@ a
-99999999.99
999999999.99
999999999.99
999999999.99
0.00
-99999999.99
123.40
12340.00
1.23
1230.00
123.00
drop table t1;
create table t1 (a decimal);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
...
...
mysql-test/t/type_decimal.test
View file @
e773a26e
...
...
@@ -160,6 +160,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.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
;
drop
table
t1
;
...
...
@@ -169,6 +171,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.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
;
drop
table
t1
;
...
...
@@ -178,6 +182,8 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert
into
t1
values
(
"00000000000001"
),(
"+0000000000001"
),(
"-0000000000001"
);
insert
into
t1
values
(
"+111111111.11"
),(
"111111111.11"
),(
"-11111111.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
;
drop
table
t1
;
...
...
@@ -189,6 +195,8 @@ insert into t1 values (-.1),(+.1),(.1);
insert
into
t1
values
(
00000000000001
),(
+
0000000000001
),(
-
0000000000001
);
insert
into
t1
values
(
+
111111111.11
),(
111111111.11
),(
-
11111111.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
;
drop
table
t1
;
...
...
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