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
0119932a
Commit
0119932a
authored
Oct 31, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug #1688 "CREATE TABLE ... SELECT with default()"
parent
d5cf9da4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
mysql-test/r/create.result
mysql-test/r/create.result
+16
-0
mysql-test/t/create.test
mysql-test/t/create.test
+7
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-0
No files found.
mysql-test/r/create.result
View file @
0119932a
...
...
@@ -411,6 +411,22 @@ a b c d e f g h dd
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
2 -2 2 1825-12-14 a 2003-01-01 03:02:01 04:03:02 binary data 02:00:00
drop table t1, t2;
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
insert into t1 values ('','',0,0.0);
describe t1;
Field Type Null Key Default Extra
str varchar(10) YES def
strnull varchar(10) YES NULL
intg int(11) YES 10
rel double YES 3.14
create table t2 select default(str) as str, default(strnull) as strnull, default(intg) as intg, default(rel) as rel from t1;
describe t2;
Field Type Null Key Default Extra
str varchar(10) YES NULL
strnull varchar(10) YES NULL
intg int(11) YES NULL
rel double YES NULL
drop table t1, t2;
drop database if exists test_$1;
create database test_$1;
use test_$1;
...
...
mysql-test/t/create.test
View file @
0119932a
...
...
@@ -318,6 +318,13 @@ select * from t2;
drop
table
t1
,
t2
;
create
table
t1
(
str
varchar
(
10
)
default
'def'
,
strnull
varchar
(
10
),
intg
int
default
'10'
,
rel
double
default
'3.14'
);
insert
into
t1
values
(
''
,
''
,
0
,
0.0
);
describe
t1
;
create
table
t2
select
default
(
str
)
as
str
,
default
(
strnull
)
as
strnull
,
default
(
intg
)
as
intg
,
default
(
rel
)
as
rel
from
t1
;
describe
t2
;
drop
table
t1
,
t2
;
#
# Bug #1209
#
...
...
sql/sql_select.cc
View file @
0119932a
...
...
@@ -4473,6 +4473,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
return
0
;
// Error
}
case
Item
:
:
FIELD_ITEM
:
case
Item
:
:
DEFAULT_VALUE_ITEM
:
{
Field
*
org_field
=
((
Item_field
*
)
item
)
->
field
,
*
new_field
;
...
...
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