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
60d60a29
Commit
60d60a29
authored
Nov 16, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Item_uint::save_in_field() added to take into account bigint->decimal case
parent
9837748e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
1 deletion
+36
-1
.bzrignore
.bzrignore
+1
-0
mysql-test/r/bigint.result
mysql-test/r/bigint.result
+8
-0
mysql-test/t/bigint.test
mysql-test/t/bigint.test
+12
-0
sql/item.cc
sql/item.cc
+13
-0
sql/item.h
sql/item.h
+2
-1
No files found.
.bzrignore
View file @
60d60a29
...
...
@@ -540,3 +540,4 @@ libmysql/vio_priv.h
libmysql_r/vio_priv.h
hardcopy.0
scripts/make_sharedlib_distribution
sql/udf_example.so
mysql-test/r/bigint.result
View file @
60d60a29
...
...
@@ -67,3 +67,11 @@ select * from t1 limit 9999999999;
id a
9999999999 1
drop table t1;
CREATE TABLE t1 ( quantity decimal(60,0));
insert into t1 values (10000000000000000000);
insert into t1 values ('10000000000000000000');
select * from t1;
quantity
10000000000000000000
10000000000000000000
drop table t1;
mysql-test/t/bigint.test
View file @
60d60a29
...
...
@@ -46,3 +46,15 @@ insert into t1 values (null,1);
select
*
from
t1
;
select
*
from
t1
limit
9999999999
;
drop
table
t1
;
#
# Item_uint::save_to_field()
# BUG#1845
#
CREATE
TABLE
t1
(
quantity
decimal
(
60
,
0
));
insert
into
t1
values
(
10000000000000000000
);
insert
into
t1
values
(
'10000000000000000000'
);
select
*
from
t1
;
drop
table
t1
;
sql/item.cc
View file @
60d60a29
...
...
@@ -548,6 +548,19 @@ bool Item_string::save_in_field(Field *field, bool no_conversions)
return
0
;
}
bool
Item_uint
::
save_in_field
(
Field
*
field
,
bool
no_conversions
)
{
longlong
nr
=
val_int
();
if
(
null_value
)
return
set_field_to_null
(
field
);
field
->
set_notnull
();
if
(
nr
<
0
)
field
->
store
(
ulonglong2double
(
nr
));
else
field
->
store
(
nr
);
return
0
;
}
bool
Item_int
::
save_in_field
(
Field
*
field
,
bool
no_conversions
)
{
longlong
nr
=
val_int
();
...
...
sql/item.h
View file @
60d60a29
...
...
@@ -232,6 +232,7 @@ class Item_uint :public Item_int
String
*
val_str
(
String
*
);
void
make_field
(
Send_field
*
field
);
Item
*
new_item
()
{
return
new
Item_uint
(
name
,
max_length
);
}
bool
save_in_field
(
Field
*
field
,
bool
no_conversions
);
bool
fix_fields
(
THD
*
thd
,
struct
st_table_list
*
table_list
)
{
unsigned_flag
=
1
;
...
...
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