Commit 338325a0 authored by unknown's avatar unknown

Merge mysql.com:/home/bkroot/mysql-5.0

into  mysql.com:/home/bk/mysql-5.0

parents 8daa1c42 327afd65
......@@ -76,8 +76,8 @@ BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib mysqlclient.lib mysys.lib regex.lib ..\extra\yassl\Release\yassl.lib /nologo /out:"..\client_release\mysql_client_test.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console
!ENDIF
......
......@@ -149,13 +149,13 @@ v5 VIEW
v6 VIEW
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 MyISAM 10 Fixed 5 9 45 2533274790395903 1024 0 NULL # # NULL latin1_swedish_ci NULL
v1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
v2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
v3 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
v4 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
v5 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
v6 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL # # NULL NULL NULL NULL view
t1 MyISAM 10 Fixed 5 9 45 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
v2 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
v3 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
v4 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
v5 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
v6 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL view
drop view v1,v2,v3,v4,v5,v6;
create view v1 (c,d,e,f) as select a,b,
a in (select a+2 from t1), a = all (select a from t1) from t1;
......@@ -1953,6 +1953,16 @@ s1 s2
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
create table t1 (f1 int, f2 int);
create view v1 as select f1 as f3, f2 as f1 from t1;
insert into t1 values (1,3),(2,1),(3,2);
select * from v1 order by f1;
f3 f1
2 1
3 2
1 3
drop view v1;
drop table t1;
CREATE TABLE t1 (f1 char) ENGINE = innodb;
INSERT INTO t1 VALUES ('A');
CREATE VIEW v1 AS SELECT * FROM t1;
......
......@@ -83,8 +83,7 @@ explain extended select c from v6;
# show table/table status test
show tables;
show full tables;
--replace_column 12 # 13 #
--replace_result 2147483647 38654705663
--replace_column 8 # 12 # 13 #
show table status;
drop view v1,v2,v3,v4,v5,v6;
......@@ -1792,6 +1791,16 @@ DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;
#
# Test for bug #11709 View was ordered by wrong column
#
create table t1 (f1 int, f2 int);
create view v1 as select f1 as f3, f2 as f1 from t1;
insert into t1 values (1,3),(2,1),(3,2);
select * from v1 order by f1;
drop view v1;
drop table t1;
#
# Test for bug #11771: wrong query_id in SELECT * FROM <view>
#
......
......@@ -4499,6 +4499,35 @@ bool Item_direct_view_ref::fix_fields(THD *thd, Item **reference)
return Item_direct_ref::fix_fields(thd, reference);
}
/*
Compare view field's name with item's name before call to referenced
item's eq()
SYNOPSIS
Item_direct_view_ref::eq()
item item to compare with
binary_cmp make binary comparison
DESCRIPTION
Consider queries:
create view v1 as select t1.f1 as f2, t1.f2 as f1 from t1;
select * from v1 order by f1;
In order to choose right field for sorting we need to compare
given item's name (f1) to view field's name prior to calling
referenced item's eq().
RETURN
TRUE Referenced item is equal to given item
FALSE otherwise
*/
bool Item_direct_view_ref::eq(const Item *item, bool binary_cmp) const
{
Item *it= ((Item *) item)->real_item();
return (!it->name || !my_strcasecmp(system_charset_info, it->name,
field_name)) && ref && (*ref)->real_item()->eq(it, binary_cmp);
}
void Item_null_helper::print(String *str)
{
......
......@@ -1524,6 +1524,7 @@ class Item_direct_view_ref :public Item_direct_ref
:Item_direct_ref(thd, item) {}
bool fix_fields(THD *, Item **);
bool eq(const Item *item, bool binary_cmp) const;
};
......
......@@ -1118,7 +1118,7 @@ int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
table_list= (table_list->belong_to_view ?
table_list->belong_to_view :
table_list);
view= (bool)(table_list->view);
view= test(table_list->view);
}
if (view)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment