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
8cc5f88b
Commit
8cc5f88b
authored
Jun 14, 2005
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.clean
parents
a99599bc
0dce6464
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
9 deletions
+22
-9
mysql-test/r/func_default.result
mysql-test/r/func_default.result
+5
-0
mysql-test/t/func_default.test
mysql-test/t/func_default.test
+11
-1
sql/item.cc
sql/item.cc
+6
-8
No files found.
mysql-test/r/func_default.result
View file @
8cc5f88b
...
@@ -16,3 +16,8 @@ explain select * from t1 where str <> default(str);
...
@@ -16,3 +16,8 @@ explain select * from t1 where str <> default(str);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
1 SIMPLE t1 system NULL NULL NULL NULL 1
drop table t1;
drop table t1;
CREATE TABLE t1 (id int(11), s varchar(20));
INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
ERROR HY000: Field 'mi' doesn't have a default value
DROP TABLE t1;
mysql-test/t/func_default.test
View file @
8cc5f88b
...
@@ -17,3 +17,13 @@ explain select * from t1 where str <> default(str);
...
@@ -17,3 +17,13 @@ explain select * from t1 where str <> default(str);
#insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1;
#insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1;
drop
table
t1
;
drop
table
t1
;
#
# Bug #11314 (HAVING DEFAULT() hangs)
#
CREATE
TABLE
t1
(
id
int
(
11
),
s
varchar
(
20
));
INSERT
INTO
t1
VALUES
(
1
,
'one'
),
(
2
,
'two'
),
(
3
,
'three'
);
--
error
1364
SELECT
s
,
32
AS
mi
FROM
t1
GROUP
BY
s
HAVING
DEFAULT
(
mi
)
IS
NULL
;
DROP
TABLE
t1
;
sql/item.cc
View file @
8cc5f88b
...
@@ -4455,15 +4455,13 @@ bool Item_default_value::fix_fields(THD *thd,
...
@@ -4455,15 +4455,13 @@ bool Item_default_value::fix_fields(THD *thd,
if
(
!
arg
->
fixed
&&
arg
->
fix_fields
(
thd
,
table_list
,
&
arg
))
if
(
!
arg
->
fixed
&&
arg
->
fix_fields
(
thd
,
table_list
,
&
arg
))
return
TRUE
;
return
TRUE
;
if
(
arg
->
type
()
==
REF_ITEM
)
arg
=
arg
->
real_item
();
{
if
(
arg
->
type
()
!=
FIELD_ITEM
)
Item_ref
*
ref
=
(
Item_ref
*
)
arg
;
if
(
ref
->
ref
[
0
]
->
type
()
!=
FIELD_ITEM
)
{
{
my_error
(
ER_NO_DEFAULT_FOR_FIELD
,
MYF
(
0
),
arg
->
name
);
return
TRUE
;
return
TRUE
;
}
}
arg
=
ref
->
ref
[
0
];
}
field_arg
=
(
Item_field
*
)
arg
;
field_arg
=
(
Item_field
*
)
arg
;
if
(
field_arg
->
field
->
flags
&
NO_DEFAULT_VALUE_FLAG
)
if
(
field_arg
->
field
->
flags
&
NO_DEFAULT_VALUE_FLAG
)
{
{
...
...
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