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
1a25c55e
Commit
1a25c55e
authored
Mar 30, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix (bug #9401: type_timestamp segfaults mysqld)
parent
456aba6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
sql/sql_select.cc
sql/sql_select.cc
+17
-15
No files found.
sql/sql_select.cc
View file @
1a25c55e
...
@@ -4604,14 +4604,14 @@ const_expression_in_where(COND *cond, Item *comp_item, Item **const_item)
...
@@ -4604,14 +4604,14 @@ const_expression_in_where(COND *cond, Item *comp_item, Item **const_item)
create_tmp_field_from_field()
create_tmp_field_from_field()
thd Thread handler
thd Thread handler
org_field field from which new field will be created
org_field field from which new field will be created
name New field name
item Item to create a field for
item Item to create a field for
table Temporary table
table Temporary table
modify_item 1 if item->result_field should point to new item.
item !=NULL if item->result_field should point to new field.
This is relevent for how fill_record() is going to
This is relevant for how fill_record() is going to work:
work:
If item != NULL then fill_record() will update
If modify_item is 1 then fill_record() will update
the record in the original table.
the record in the original table.
If
modify_item is 0
then fill_record() will update
If
item == NULL
then fill_record() will update
the temporary table
the temporary table
convert_blob_length If >0 create a varstring(convert_blob_length) field
convert_blob_length If >0 create a varstring(convert_blob_length) field
instead of blob.
instead of blob.
...
@@ -4622,8 +4622,8 @@ const_expression_in_where(COND *cond, Item *comp_item, Item **const_item)
...
@@ -4622,8 +4622,8 @@ const_expression_in_where(COND *cond, Item *comp_item, Item **const_item)
*/
*/
static
Field
*
create_tmp_field_from_field
(
THD
*
thd
,
Field
*
org_field
,
static
Field
*
create_tmp_field_from_field
(
THD
*
thd
,
Field
*
org_field
,
Item
*
item
,
TABLE
*
table
,
const
char
*
name
,
TABLE
*
table
,
bool
modify_
item
,
Item_field
*
item
,
uint
convert_blob_length
)
uint
convert_blob_length
)
{
{
Field
*
new_field
;
Field
*
new_field
;
...
@@ -4636,10 +4636,10 @@ static Field* create_tmp_field_from_field(THD *thd, Field* org_field,
...
@@ -4636,10 +4636,10 @@ static Field* create_tmp_field_from_field(THD *thd, Field* org_field,
new_field
=
org_field
->
new_field
(
thd
->
mem_root
,
table
);
new_field
=
org_field
->
new_field
(
thd
->
mem_root
,
table
);
if
(
new_field
)
if
(
new_field
)
{
{
if
(
modify_
item
)
if
(
item
)
((
Item_field
*
)
item
)
->
result_field
=
new_field
;
item
->
result_field
=
new_field
;
else
else
new_field
->
field_name
=
item
->
name
;
new_field
->
field_name
=
name
;
if
(
org_field
->
maybe_null
())
if
(
org_field
->
maybe_null
())
new_field
->
flags
&=
~
NOT_NULL_FLAG
;
// Because of outer join
new_field
->
flags
&=
~
NOT_NULL_FLAG
;
// Because of outer join
if
(
org_field
->
type
()
==
FIELD_TYPE_VAR_STRING
)
if
(
org_field
->
type
()
==
FIELD_TYPE_VAR_STRING
)
...
@@ -4779,8 +4779,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
...
@@ -4779,8 +4779,8 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
if
(
item_sum
->
args
[
0
]
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
item_sum
->
args
[
0
]
->
type
()
==
Item
::
FIELD_ITEM
)
{
{
*
from_field
=
((
Item_field
*
)
item_sum
->
args
[
0
])
->
field
;
*
from_field
=
((
Item_field
*
)
item_sum
->
args
[
0
])
->
field
;
return
create_tmp_field_from_field
(
thd
,
*
from_field
,
item
,
table
,
return
create_tmp_field_from_field
(
thd
,
*
from_field
,
item
->
name
,
table
,
modify_item
,
convert_blob_length
);
NULL
,
convert_blob_length
);
}
}
/* fall through */
/* fall through */
default:
default:
...
@@ -4818,8 +4818,10 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
...
@@ -4818,8 +4818,10 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
case
Item
:
:
DEFAULT_VALUE_ITEM
:
case
Item
:
:
DEFAULT_VALUE_ITEM
:
{
{
Item_field
*
field
=
(
Item_field
*
)
item
;
Item_field
*
field
=
(
Item_field
*
)
item
;
return
create_tmp_field_from_field
(
thd
,
(
*
from_field
=
field
->
field
),
item
,
return
create_tmp_field_from_field
(
thd
,
(
*
from_field
=
field
->
field
),
table
,
modify_item
,
convert_blob_length
);
item
->
name
,
table
,
modify_item
?
(
Item_field
*
)
item
:
NULL
,
convert_blob_length
);
}
}
case
Item
:
:
FUNC_ITEM
:
case
Item
:
:
FUNC_ITEM
:
case
Item
:
:
COND_ITEM
:
case
Item
:
:
COND_ITEM
:
...
@@ -4840,7 +4842,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
...
@@ -4840,7 +4842,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
{
{
Field
*
example
=
((
Item_type_holder
*
)
item
)
->
example
();
Field
*
example
=
((
Item_type_holder
*
)
item
)
->
example
();
if
(
example
)
if
(
example
)
return
create_tmp_field_from_field
(
thd
,
example
,
item
,
table
,
0
,
return
create_tmp_field_from_field
(
thd
,
example
,
item
->
name
,
table
,
NULL
,
convert_blob_length
);
convert_blob_length
);
return
create_tmp_field_from_item
(
thd
,
item
,
table
,
copy_func
,
0
,
return
create_tmp_field_from_item
(
thd
,
item
,
table
,
copy_func
,
0
,
convert_blob_length
);
convert_blob_length
);
...
...
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