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
7bd64afe
Commit
7bd64afe
authored
May 19, 2009
by
Gleb Shchepa
Browse files
Options
Browse Files
Download
Plain Diff
manual merge 5.0-bugteam --> 5.1-bugteam (bug 40825)
parents
189f8ebd
8a39147a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
1 deletion
+44
-1
mysql-test/r/view.result
mysql-test/r/view.result
+19
-0
mysql-test/t/view.test
mysql-test/t/view.test
+23
-0
sql/item.cc
sql/item.cc
+2
-1
No files found.
mysql-test/r/view.result
View file @
7bd64afe
...
@@ -3699,6 +3699,25 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
...
@@ -3699,6 +3699,25 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
ERROR 42000: Key 'c2' doesn't exist in table 'v1'
ERROR 42000: Key 'c2' doesn't exist in table 'v1'
DROP VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
DROP TABLE t1;
# -----------------------------------------------------------------
# -- Bug#40825: Error 1356 while selecting from a view
# -- with a "HAVING" clause though query works
# -----------------------------------------------------------------
CREATE TABLE t1 (c INT);
CREATE VIEW v1 (view_column) AS SELECT c AS alias FROM t1 HAVING alias;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`c` AS `view_column` from `t1` having `view_column` latin1 latin1_swedish_ci
SELECT * FROM v1;
view_column
DROP VIEW v1;
DROP TABLE t1;
# -- End of test case for Bug#40825
# -----------------------------------------------------------------
# -----------------------------------------------------------------
# -- End of 5.0 tests.
# -- End of 5.0 tests.
# -----------------------------------------------------------------
# -----------------------------------------------------------------
...
...
mysql-test/t/view.test
View file @
7bd64afe
...
@@ -3680,6 +3680,29 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
...
@@ -3680,6 +3680,29 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
DROP
VIEW
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
# -----------------------------------------------------------------
--
echo
# -- Bug#40825: Error 1356 while selecting from a view
--
echo
# -- with a "HAVING" clause though query works
--
echo
# -----------------------------------------------------------------
--
echo
CREATE
TABLE
t1
(
c
INT
);
--
echo
CREATE
VIEW
v1
(
view_column
)
AS
SELECT
c
AS
alias
FROM
t1
HAVING
alias
;
SHOW
CREATE
VIEW
v1
;
SELECT
*
FROM
v1
;
--
echo
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
--
echo
# -- End of test case for Bug#40825
--
echo
--
echo
# -----------------------------------------------------------------
--
echo
# -----------------------------------------------------------------
--
echo
# -- End of 5.0 tests.
--
echo
# -- End of 5.0 tests.
--
echo
# -----------------------------------------------------------------
--
echo
# -----------------------------------------------------------------
...
...
sql/item.cc
View file @
7bd64afe
...
@@ -5810,7 +5810,8 @@ void Item_ref::print(String *str, enum_query_type query_type)
...
@@ -5810,7 +5810,8 @@ void Item_ref::print(String *str, enum_query_type query_type)
!
table_name
&&
name
&&
alias_name_used
)
!
table_name
&&
name
&&
alias_name_used
)
{
{
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
append_identifier
(
thd
,
str
,
name
,
(
uint
)
strlen
(
name
));
append_identifier
(
thd
,
str
,
(
*
ref
)
->
real_item
()
->
name
,
(
*
ref
)
->
real_item
()
->
name_length
);
}
}
else
else
(
*
ref
)
->
print
(
str
,
query_type
);
(
*
ref
)
->
print
(
str
,
query_type
);
...
...
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