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
7145dedb
Commit
7145dedb
authored
Jul 21, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test of duplicate field names (BUG#4608)
parent
ad9a6e08
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
mysql-test/r/view.result
mysql-test/r/view.result
+2
-0
mysql-test/t/view.test
mysql-test/t/view.test
+6
-0
sql/sql_view.cc
sql/sql_view.cc
+20
-0
No files found.
mysql-test/r/view.result
View file @
7145dedb
...
@@ -975,3 +975,5 @@ drop table t1;
...
@@ -975,3 +975,5 @@ drop table t1;
select * from v1;
select * from v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
drop view v1;
drop view v1;
create view v1 (a,a) as select 'a','a';
ERROR 42S21: Duplicate column name 'a'
mysql-test/t/view.test
View file @
7145dedb
...
@@ -894,3 +894,9 @@ drop table t1;
...
@@ -894,3 +894,9 @@ drop table t1;
--
error
1354
--
error
1354
select
*
from
v1
;
select
*
from
v1
;
drop
view
v1
;
drop
view
v1
;
#
# check of duplication of column names
#
--
error
1060
create
view
v1
(
a
,
a
)
as
select
'a'
,
'a'
;
sql/sql_view.cc
View file @
7145dedb
...
@@ -204,6 +204,26 @@ int mysql_create_view(THD *thd,
...
@@ -204,6 +204,26 @@ int mysql_create_view(THD *thd,
}
}
}
}
/* Test absence of duplicates names */
{
Item
*
item
;
List_iterator_fast
<
Item
>
it
(
select_lex
->
item_list
);
it
++
;
while
((
item
=
it
++
))
{
Item
*
check
;
List_iterator_fast
<
Item
>
itc
(
select_lex
->
item_list
);
while
((
check
=
itc
++
)
&&
check
!=
item
)
{
if
(
strcmp
(
item
->
name
,
check
->
name
)
==
0
)
{
my_error
(
ER_DUP_FIELDNAME
,
MYF
(
0
),
item
->
name
);
DBUG_RETURN
(
-
1
);
}
}
}
}
#ifndef NO_EMBEDDED_ACCESS_CHECKS
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/*
/*
Compare/check grants on view with grants of underlaying tables
Compare/check grants on view with grants of underlaying tables
...
...
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