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
9fb7e863
Commit
9fb7e863
authored
Jul 01, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimized old patches
Don't set field to DEFAULT value when set to NULL
parent
5dab55de
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
17 deletions
+14
-17
mysql-test/r/insert.result
mysql-test/r/insert.result
+1
-1
sql/field_conv.cc
sql/field_conv.cc
+3
-3
sql/item_strfunc.cc
sql/item_strfunc.cc
+5
-12
sql/opt_range.cc
sql/opt_range.cc
+5
-1
No files found.
mysql-test/r/insert.result
View file @
9fb7e863
...
...
@@ -65,7 +65,7 @@ insert into t1 values (1), (NULL), (2);
select * from t1;
id
1
8
0
2
drop table t1;
drop database if exists foo;
...
...
sql/field_conv.cc
View file @
9fb7e863
/* Copyright (C) 2000
MySQL AB & MySQL Finland AB & TCX DataKonsult
AB
/* Copyright (C) 2000
-2003 MySQL
AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -118,7 +118,7 @@ set_field_to_null(Field *field)
field
->
reset
();
return
0
;
}
field
->
set_defaul
t
();
field
->
rese
t
();
if
(
current_thd
->
count_cuted_fields
)
{
current_thd
->
cuted_fields
++
;
// Increment error counter
...
...
@@ -170,7 +170,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
((
Field_timestamp
*
)
field
)
->
set_time
();
return
0
;
// Ok to set time to NULL
}
field
->
set_defaul
t
();
field
->
rese
t
();
if
(
field
==
field
->
table
->
next_number_field
)
return
0
;
// field is set in handler.cc
if
(
current_thd
->
count_cuted_fields
)
...
...
sql/item_strfunc.cc
View file @
9fb7e863
...
...
@@ -1546,13 +1546,11 @@ double Item_func_elt::val()
return
0.0
;
double
result
=
args
[
tmp
-
1
]
->
val
();
if
(
args
[
tmp
-
1
]
->
is_null
())
return
0.0
;
null_value
=
0
;
null_value
=
args
[
tmp
-
1
]
->
null_value
;
return
result
;
}
longlong
Item_func_elt
::
val_int
()
{
uint
tmp
;
...
...
@@ -1561,13 +1559,11 @@ longlong Item_func_elt::val_int()
return
0
;
int
result
=
args
[
tmp
-
1
]
->
val_int
();
if
(
args
[
tmp
-
1
]
->
is_null
())
return
0
;
null_value
=
0
;
null_value
=
args
[
tmp
-
1
]
->
null_value
;
return
result
;
}
String
*
Item_func_elt
::
val_str
(
String
*
str
)
{
uint
tmp
;
...
...
@@ -1576,10 +1572,7 @@ String *Item_func_elt::val_str(String *str)
return
NULL
;
String
*
result
=
args
[
tmp
-
1
]
->
val_str
(
str
);
if
(
args
[
tmp
-
1
]
->
is_null
())
return
NULL
;
null_value
=
0
;
null_value
=
args
[
tmp
-
1
]
->
null_value
;
return
result
;
}
...
...
sql/opt_range.cc
View file @
9fb7e863
...
...
@@ -2409,7 +2409,11 @@ QUICK_SELECT *get_quick_select_for_ref(TABLE *table, TABLE_REF *ref)
if
(
!
quick
)
return
0
;
if
(
cp_buffer_from_ref
(
ref
))
return
quick
;
/* empty range */
{
if
(
current_thd
->
fatal_error
)
return
0
;
// End of memory
return
quick
;
// empty range
}
QUICK_RANGE
*
range
=
new
QUICK_RANGE
();
if
(
!
range
)
...
...
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