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
c7964159
Commit
c7964159
authored
Jan 25, 2012
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#13463415 followup: compensate for compiler bug
parent
042bd151
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
sql/item.cc
sql/item.cc
+12
-3
No files found.
sql/item.cc
View file @
c7964159
...
...
@@ -7399,9 +7399,13 @@ void resolve_const_item(THD *thd, Item **ref, Item *comp_item)
or less than the original Item. A 0 may also be returned if
out of memory.
@note We
only use this o
n the range optimizer/partition pruning,
@note We
use this i
n the range optimizer/partition pruning,
because in some cases we can't store the value in the field
without some precision/character loss.
We similarly use it to verify that expressions like
BIGINT_FIELD <cmp> <literal value>
is done correctly (as int/decimal/float according to literal type).
*/
int
stored_field_cmp_to_item
(
THD
*
thd
,
Field
*
field
,
Item
*
item
)
...
...
@@ -7459,10 +7463,15 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
field_val
=
field
->
val_decimal
(
&
field_buf
);
return
my_decimal_cmp
(
item_val
,
field_val
);
}
double
result
=
item
->
val_real
();
/*
The patch for Bug#13463415 started using this function for comparing
BIGINTs. That uncovered a bug in Visual Studio 32bit optimized mode.
Prefixing the auto variables with volatile fixes the problem....
*/
volatile
double
result
=
item
->
val_real
();
if
(
item
->
null_value
)
return
0
;
double
field_result
=
field
->
val_real
();
volatile
double
field_result
=
field
->
val_real
();
if
(
field_result
<
result
)
return
-
1
;
else
if
(
field_result
>
result
)
...
...
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