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
bc8ff197
Commit
bc8ff197
authored
Sep 27, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge pgalbraith@bk-internal.mysql.com:/home/bk/mysql-5.0
into krsna.patg.net:/home/patg/mysql-5.0
parents
aa24e719
4ca04346
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
7 deletions
+61
-7
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+4
-2
mysql-test/r/view.result
mysql-test/r/view.result
+26
-0
mysql-test/t/view.test
mysql-test/t/view.test
+26
-0
sql/item.cc
sql/item.cc
+4
-4
sql/sql_base.cc
sql/sql_base.cc
+1
-1
No files found.
mysql-test/mysql-test-run.pl
View file @
bc8ff197
...
...
@@ -2137,7 +2137,8 @@ sub mysqld_start ($$$$) {
{
if
(
$pid
=
mtr_spawn
(
$exe
,
$args
,
"",
$master
->
[
$idx
]
->
{'
path_myerr
'},
$master
->
[
$idx
]
->
{'
path_myerr
'},
"")
)
$master
->
[
$idx
]
->
{'
path_myerr
'},
"",
{
append_log_file
=>
1
})
)
{
return
sleep_until_file_created
(
$master
->
[
$idx
]
->
{'
path_mypid
'},
$master
->
[
$idx
]
->
{'
start_timeout
'},
$pid
);
...
...
@@ -2148,7 +2149,8 @@ sub mysqld_start ($$$$) {
{
if
(
$pid
=
mtr_spawn
(
$exe
,
$args
,
"",
$slave
->
[
$idx
]
->
{'
path_myerr
'},
$slave
->
[
$idx
]
->
{'
path_myerr
'},
"")
)
$slave
->
[
$idx
]
->
{'
path_myerr
'},
"",
{
append_log_file
=>
1
})
)
{
return
sleep_until_file_created
(
$slave
->
[
$idx
]
->
{'
path_mypid
'},
$master
->
[
$idx
]
->
{'
start_timeout
'},
$pid
);
...
...
mysql-test/r/view.result
View file @
bc8ff197
...
...
@@ -2262,3 +2262,29 @@ WEEKDAY(date)
1
DROP TABLE t1;
DROP VIEW v1, v2, v3;
CREATE TABLE t1 ( a int, b int );
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
CREATE VIEW v1 AS SELECT a,b FROM t1;
SELECT t1.a FROM t1 GROUP BY t1.a HAVING a > 1;
a
2
3
SELECT v1.a FROM v1 GROUP BY v1.a HAVING a > 1;
a
2
3
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 ( a int, b int );
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
CREATE VIEW v1 AS SELECT a,b FROM t1;
SELECT t1.a FROM t1 GROUP BY t1.a HAVING t1.a > 1;
a
2
3
SELECT v1.a FROM v1 GROUP BY v1.a HAVING v1.a > 1;
a
2
3
DROP VIEW v1;
DROP TABLE t1;
mysql-test/t/view.test
View file @
bc8ff197
...
...
@@ -2139,3 +2139,29 @@ SELECT * FROM v3;
DROP
TABLE
t1
;
DROP
VIEW
v1
,
v2
,
v3
;
#
# Bug #13411: crash when using non-qualified view column in HAVING clause
#
CREATE
TABLE
t1
(
a
int
,
b
int
);
INSERT
INTO
t1
VALUES
(
1
,
1
),(
2
,
2
),(
3
,
3
);
CREATE
VIEW
v1
AS
SELECT
a
,
b
FROM
t1
;
SELECT
t1
.
a
FROM
t1
GROUP
BY
t1
.
a
HAVING
a
>
1
;
SELECT
v1
.
a
FROM
v1
GROUP
BY
v1
.
a
HAVING
a
>
1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
#
# Bug #13410: failed name resolution for qualified view column in HAVING
#
CREATE
TABLE
t1
(
a
int
,
b
int
);
INSERT
INTO
t1
VALUES
(
1
,
1
),(
2
,
2
),(
3
,
3
);
CREATE
VIEW
v1
AS
SELECT
a
,
b
FROM
t1
;
SELECT
t1
.
a
FROM
t1
GROUP
BY
t1
.
a
HAVING
t1
.
a
>
1
;
SELECT
v1
.
a
FROM
v1
GROUP
BY
v1
.
a
HAVING
v1
.
a
>
1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
sql/item.cc
View file @
bc8ff197
...
...
@@ -1687,7 +1687,7 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const
return
0
;
Item_field
*
item_field
=
(
Item_field
*
)
item
;
if
(
item_field
->
field
)
if
(
item_field
->
field
&&
field
)
return
item_field
->
field
==
field
;
/*
We may come here when we are trying to find a function in a GROUP BY
...
...
@@ -1701,10 +1701,10 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const
*/
return
(
!
my_strcasecmp
(
system_charset_info
,
item_field
->
name
,
field_name
)
&&
(
!
item_field
->
table_name
||
(
!
item_field
->
table_name
||
!
table_name
||
(
!
my_strcasecmp
(
table_alias_charset
,
item_field
->
table_name
,
table_name
)
&&
(
!
item_field
->
db_name
||
(
!
item_field
->
db_name
||
!
db_name
||
(
item_field
->
db_name
&&
!
strcmp
(
item_field
->
db_name
,
db_name
))))));
}
...
...
@@ -2983,7 +2983,7 @@ static Item** find_field_in_group_list(Item *find_item, ORDER *group_list)
for
(
ORDER
*
cur_group
=
group_list
;
cur_group
;
cur_group
=
cur_group
->
next
)
{
if
((
*
(
cur_group
->
item
))
->
type
()
==
Item
::
FIELD_ITEM
)
if
((
*
(
cur_group
->
item
))
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
{
cur_field
=
(
Item_field
*
)
*
cur_group
->
item
;
cur_match_degree
=
0
;
...
...
sql/sql_base.cc
View file @
bc8ff197
...
...
@@ -3459,7 +3459,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
}
}
}
else
if
(
!
table_name
&&
(
item
->
eq
(
find
,
0
)
||
else
if
(
!
table_name
&&
(
find
->
eq
(
item
,
0
)
||
find
->
name
&&
item
->
name
&&
!
my_strcasecmp
(
system_charset_info
,
item
->
name
,
find
->
name
)))
...
...
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