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
283d51b6
Commit
283d51b6
authored
Jun 27, 2006
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #18014: data loss caused by altering decimal fields.
parent
0ce586f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
0 deletions
+34
-0
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
+11
-0
sql/field.cc
sql/field.cc
+12
-0
sql/field.h
sql/field.h
+1
-0
No files found.
mysql-test/r/type_newdecimal.result
View file @
283d51b6
...
...
@@ -1397,3 +1397,13 @@ c1
9999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999
drop table t1;
create table t1(a decimal(7,2));
insert into t1 values(123.12);
select * from t1;
a
123.12
alter table t1 modify a decimal(10,2);
select * from t1;
a
123.12
drop table t1;
mysql-test/t/type_newdecimal.test
View file @
283d51b6
...
...
@@ -1095,3 +1095,14 @@ insert into t1 values(
insert
into
t1
values
(
1
e100
);
select
*
from
t1
;
drop
table
t1
;
#
# Bug #18014: problem with 'alter table'
#
create
table
t1
(
a
decimal
(
7
,
2
));
insert
into
t1
values
(
123.12
);
select
*
from
t1
;
alter
table
t1
modify
a
decimal
(
10
,
2
);
select
*
from
t1
;
drop
table
t1
;
sql/field.cc
View file @
283d51b6
...
...
@@ -2604,6 +2604,18 @@ void Field_new_decimal::sql_type(String &str) const
}
uint
Field_new_decimal
::
is_equal
(
create_field
*
new_field
)
{
return
((
new_field
->
sql_type
==
real_type
())
&&
((
new_field
->
flags
&
UNSIGNED_FLAG
)
==
(
uint
)
(
flags
&
UNSIGNED_FLAG
))
&&
((
new_field
->
flags
&
AUTO_INCREMENT_FLAG
)
==
(
uint
)
(
flags
&
AUTO_INCREMENT_FLAG
))
&&
(
new_field
->
length
==
max_length
())
&&
(
new_field
->
decimals
==
dec
));
}
/****************************************************************************
** tiny int
****************************************************************************/
...
...
sql/field.h
View file @
283d51b6
...
...
@@ -514,6 +514,7 @@ public:
uint32
max_length
()
{
return
field_length
;
}
uint
size_of
()
const
{
return
sizeof
(
*
this
);
}
uint32
pack_length
()
const
{
return
(
uint32
)
bin_size
;
}
uint
is_equal
(
create_field
*
new_field
);
};
...
...
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