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
552b1c8a
Commit
552b1c8a
authored
Aug 07, 2015
by
Ajo Robert
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mysql-5.1' into mysql-5.5
parents
1d317440
f3dce250
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
15 deletions
+42
-15
sql/sql_insert.cc
sql/sql_insert.cc
+41
-15
sql/sql_select.cc
sql/sql_select.cc
+1
-0
No files found.
sql/sql_insert.cc
View file @
552b1c8a
/*
Copyright (c) 2000, 201
4
, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 201
5
, Oracle and/or its affiliates. All rights reserved.
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
...
...
@@ -3668,7 +3668,6 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
/* Add selected items to field list */
List_iterator_fast
<
Item
>
it
(
*
items
);
Item
*
item
;
Field
*
tmp_field
;
DBUG_ENTER
(
"create_table_from_items"
);
tmp_table
.
alias
=
0
;
...
...
@@ -3685,22 +3684,49 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
while
((
item
=
it
++
))
{
Create_field
*
cr_field
;
Field
*
field
,
*
def_field
;
Field
*
tmp_table_field
;
if
(
item
->
type
()
==
Item
::
FUNC_ITEM
)
{
if
(
item
->
result_type
()
!=
STRING_RESULT
)
field
=
item
->
tmp_table_field
(
&
tmp_table
);
tmp_table_
field
=
item
->
tmp_table_field
(
&
tmp_table
);
else
field
=
item
->
tmp_table_field_from_field_type
(
&
tmp_table
,
0
);
tmp_table_field
=
item
->
tmp_table_field_from_field_type
(
&
tmp_table
,
false
);
}
else
field
=
create_tmp_field
(
thd
,
&
tmp_table
,
item
,
item
->
type
(),
(
Item
***
)
0
,
&
tmp_field
,
&
def_field
,
0
,
0
,
0
,
0
,
0
);
if
(
!
field
||
!
(
cr_field
=
new
Create_field
(
field
,(
item
->
type
()
==
Item
::
FIELD_ITEM
?
((
Item_field
*
)
item
)
->
field
:
(
Field
*
)
0
))))
DBUG_RETURN
(
0
);
{
Field
*
from_field
,
*
default_field
;
tmp_table_field
=
create_tmp_field
(
thd
,
&
tmp_table
,
item
,
item
->
type
(),
(
Item
***
)
NULL
,
&
from_field
,
&
default_field
,
0
,
0
,
0
,
0
,
0
);
}
if
(
!
tmp_table_field
)
DBUG_RETURN
(
NULL
);
Field
*
table_field
;
switch
(
item
->
type
())
{
/*
We have to take into account both the real table's fields and
pseudo-fields used in trigger's body. These fields are used
to copy defaults values later inside constructor of
the class Create_field.
*/
case
Item
:
:
FIELD_ITEM
:
case
Item
:
:
TRIGGER_FIELD_ITEM
:
table_field
=
((
Item_field
*
)
item
)
->
field
;
break
;
default:
table_field
=
NULL
;
}
Create_field
*
cr_field
=
new
Create_field
(
tmp_table_field
,
table_field
);
if
(
!
cr_field
)
DBUG_RETURN
(
NULL
);
if
(
item
->
maybe_null
)
cr_field
->
flags
&=
~
NOT_NULL_FLAG
;
alter_info
->
create_list
.
push_back
(
cr_field
);
...
...
@@ -3765,7 +3791,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
}
}
if
(
!
table
)
// open failed
DBUG_RETURN
(
0
);
DBUG_RETURN
(
NULL
);
}
DEBUG_SYNC
(
thd
,
"create_table_select_before_lock"
);
...
...
sql/sql_select.cc
View file @
552b1c8a
...
...
@@ -10122,6 +10122,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
}
case
Item
:
:
FIELD_ITEM
:
case
Item
:
:
DEFAULT_VALUE_ITEM
:
case
Item
:
:
TRIGGER_FIELD_ITEM
:
{
Item_field
*
field
=
(
Item_field
*
)
item
;
bool
orig_modify
=
modify_item
;
...
...
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