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
e4ba9388
Commit
e4ba9388
authored
Jun 14, 2005
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #11314 (HAVING DEFAULT() hangs)
parent
d573d0c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
mysql-test/t/func_default.test
mysql-test/t/func_default.test
+10
-1
sql/item.cc
sql/item.cc
+6
-8
No files found.
mysql-test/t/func_default.test
View file @
e4ba9388
...
...
@@ -16,4 +16,13 @@ explain select * from t1 where str <> default(str);
#show create table from t1;
#insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1;
drop
table
t1
;
\ No newline at end of file
drop
table
t1
;
#
# Bug #11314 (HAVING DEFAULT() hangs)
#
CREATE
TABLE
t1
(
s
varchar
(
20
),
id
int
(
11
));
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
;
DROP
TABLE
t1
;
sql/item.cc
View file @
e4ba9388
...
...
@@ -4454,16 +4454,14 @@ bool Item_default_value::fix_fields(THD *thd,
}
if
(
!
arg
->
fixed
&&
arg
->
fix_fields
(
thd
,
table_list
,
&
arg
))
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
)
{
return
TRUE
;
}
arg
=
ref
->
ref
[
0
];
my_error
(
ER_NO_DEFAULT_FOR_FIELD
,
MYF
(
0
),
arg
->
name
);
return
TRUE
;
}
field_arg
=
(
Item_field
*
)
arg
;
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