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
ceb75aed
Commit
ceb75aed
authored
Jul 29, 2005
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #12173 (show create table crash)
parent
e60d786d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+10
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+8
-0
strings/decimal.c
strings/decimal.c
+2
-1
No files found.
mysql-test/r/type_newdecimal.result
View file @
ceb75aed
...
@@ -976,3 +976,13 @@ select * from t1;
...
@@ -976,3 +976,13 @@ select * from t1;
f1 f2 f3 f4 f5 f6 f7 f8
f1 f2 f3 f4 f5 f6 f7 f8
1 18 99 100 104 200 1000 10000
1 18 99 100 104 200 1000 10000
drop table t1;
drop table t1;
create table t1 (
f0 decimal (30,30) zerofill not null DEFAULT 0,
f1 decimal (0,0) zerofill not null default 0);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f0` decimal(30,30) unsigned zerofill NOT NULL default '0.000000000000000000000000000000',
`f1` decimal(10,0) unsigned zerofill NOT NULL default '0000000000'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
mysql-test/t/type_newdecimal.test
View file @
ceb75aed
...
@@ -1007,3 +1007,11 @@ insert into t1 (f1) values (1);
...
@@ -1007,3 +1007,11 @@ insert into t1 (f1) values (1);
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug 12173 (show create table fails)
#
create
table
t1
(
f0
decimal
(
30
,
30
)
zerofill
not
null
DEFAULT
0
,
f1
decimal
(
0
,
0
)
zerofill
not
null
default
0
);
show
create
table
t1
;
drop
table
t1
;
strings/decimal.c
View file @
ceb75aed
...
@@ -351,7 +351,8 @@ int decimal2string(decimal_t *from, char *to, int *to_len,
...
@@ -351,7 +351,8 @@ int decimal2string(decimal_t *from, char *to, int *to_len,
buf0
=&
tmp
;
buf0
=&
tmp
;
}
}
intg_len
=
fixed_precision
?
fixed_intg
:
(
intg
?
intg
:
1
);
if
(
!
(
intg_len
=
fixed_precision
?
fixed_intg
:
intg
))
intg_len
=
1
;
frac_len
=
fixed_precision
?
fixed_decimals
:
frac
;
frac_len
=
fixed_precision
?
fixed_decimals
:
frac
;
len
=
from
->
sign
+
intg_len
+
test
(
frac
)
+
frac_len
;
len
=
from
->
sign
+
intg_len
+
test
(
frac
)
+
frac_len
;
if
(
fixed_precision
)
if
(
fixed_precision
)
...
...
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