Commit b978c663 authored by unknown's avatar unknown
Browse files

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0

into sanja.is.com.ua:/home/bell/mysql/bk/work-multi-5.0


mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/sql_view.cc:
  Auto merged
parents a50bf2f0 0af662b9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=xilink6.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 /nologo /subsystem:console /machine:I386
# 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 Wsock32.lib ..\lib_release\vio.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe"
# 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 Wsock32.lib ..\lib_release\vio.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld.exe"
# SUBTRACT LINK32 /debug

!ELSEIF  "$(CFG)" == "mysqld - Win32 Debug"
@@ -84,7 +84,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=xilink6.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 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# 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 Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept
# 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 Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld-debug.exe" /pdbtype:sept

!ELSEIF  "$(CFG)" == "mysqld - Win32 nt"

+21 −8
Original line number Diff line number Diff line
@@ -2218,13 +2218,14 @@ static my_bool dump_all_views_in_db(char *database)
  different case (e.g.  T1 vs t1)
  
  RETURN
    void
    int - 0 if a tablename was retrieved.  1 if not
*/

static void get_actual_table_name(const char *old_table_name, 
static int get_actual_table_name(const char *old_table_name, 
                                  char *new_table_name, 
                                  int buf_size)
{
  int retval;
  MYSQL_RES  *tableRes;
  MYSQL_ROW  row;
  char query[50 + 2*NAME_LEN];
@@ -2242,10 +2243,20 @@ static void get_actual_table_name(const char *old_table_name,
  }

  tableRes= mysql_store_result( sock );
  retval = 1;
  if (tableRes != NULL)
  {
	my_ulonglong numRows = mysql_num_rows(tableRes);
	if (numRows > 0)
	{
	  	row= mysql_fetch_row( tableRes );
	  	strmake(new_table_name, row[0], buf_size-1);
		retval = 0;
	}
  	mysql_free_result(tableRes);
  }
  return retval;
}


static int dump_selected_tables(char *db, char **table_names, int tables)
@@ -2284,11 +2295,13 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
     char new_table_name[NAME_LEN];

     /* the table name passed on commandline may be wrong case */
     get_actual_table_name( table_names[i], new_table_name, sizeof(new_table_name) );
     if (!get_actual_table_name( table_names[i], new_table_name, sizeof(new_table_name) ))
     {

    	numrows = getTableStructure(new_table_name, db);

    	dumpTable(numrows, new_table_name);
     }
    my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
    order_by= 0;
  }
+14 −0
Original line number Diff line number Diff line
@@ -24,6 +24,20 @@ n
drop database if exists mysqltest;
affected rows: 1
create database mysqltest;
use mysqltest;
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28;
ERROR 42S02: Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table14,table15,table16,table17,table18,table19,table20,table21,table22,table23,table'
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28, table29, table30;
ERROR 42S02: Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table14,table15,table16,table17,table18,table19,table20,table21,table22,table23,table'
use test;
drop database mysqltest;
flush tables with read lock;
create database mysqltest;
+42 −3
Original line number Diff line number Diff line
@@ -2,6 +2,9 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
auto int(5) unsigned NOT NULL auto_increment,
string char(10) default "hello",
vstring varchar(10) default "hello",
bin binary(7),
vbin varbinary(7),
tiny tinyint(4) DEFAULT '0' NOT NULL ,
short smallint(6) DEFAULT '1' NOT NULL ,
medium mediumint(8) DEFAULT '0' NOT NULL,
@@ -9,17 +12,20 @@ long_int int(11) DEFAULT '0' NOT NULL,
longlong bigint(13) DEFAULT '0' NOT NULL,
real_float float(13,1) DEFAULT 0.0 NOT NULL,
real_double double(16,4),
real_decimal decimal(16,4),
utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
ulong int(11) unsigned DEFAULT '0' NOT NULL,
ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
time_stamp timestamp,
bits bit(3),		
options enum('one','two','tree') not null,
flags set('one','two','tree') not null,
date_field date,	
year_field year,
time_field time,	
date_time datetime,
options enum('one','two','tree') not null,
flags set('one','two','tree') not null,
time_stamp timestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (auto),
KEY (utiny),
KEY (tiny),
@@ -33,4 +39,37 @@ KEY (ulong),
KEY (ulonglong,ulong),
KEY (options,flags)
);
set @now = now();
insert into t1 
(string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
real_float,real_double, real_decimal,utiny, ushort, umedium,ulong,ulonglong,
bits,options,flags,date_field,year_field,time_field,date_time)
values
("aaaa","aaaa",0xAAAA,0xAAAA,-1,-1,-1,-1,-1,1.1,1.1,1.1,1,1,1,1,1, 
b'001','one','one', '1901-01-01','1901','01:01:01','1901-01-01 01:01:01');
select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
real_float,real_double,real_decimal,utiny,ushort,umedium,ulong,ulonglong,
bits,options,flags,date_field,year_field,time_field,date_time
from t1;
auto	string	vstring	bin	vbin	tiny	short	medium	long_int	longlong	real_float	real_double	real_decimal	utiny	ushort	umedium	ulong	ulonglong	bits	options	flags	date_field	year_field	time_field	date_time
1	aaaa	aaaa			-1	-1	-1	-1	-1	1.1	1.1000	1.1000	1	00001	1	1	1		one	one	1901-01-01	1901	01:01:01	1901-01-01 01:01:01
select time_stamp>@now from t1;
time_stamp>@now
1
set @now = now();
update t1 set string="bbbb",vstring="bbbb",bin=0xBBBB,vbin=0xBBBB,
tiny=-2,short=-2,medium=-2,long_int=-2,longlong=-2,real_float=2.2,
real_double=2.2,real_decimal=2.2,utiny=2,ushort=2,umedium=2,ulong=2,
ulonglong=2, bits=b'010',
options='one',flags='one', date_field='1902-02-02',year_field='1902',
time_field='02:02:02',date_time='1902-02-02 02:02:02' where auto=1;
select auto,string,vstring,bin,vbin,tiny,short,medium,long_int,longlong,
real_float,real_double,real_decimal,utiny,ushort,umedium,ulong,ulonglong,
bits,options,flags,date_field,year_field,time_field,date_time
from t1;
auto	string	vstring	bin	vbin	tiny	short	medium	long_int	longlong	real_float	real_double	real_decimal	utiny	ushort	umedium	ulong	ulonglong	bits	options	flags	date_field	year_field	time_field	date_time
1	bbbb	bbbb			-2	-2	-2	-2	-2	2.2	2.2000	2.2000	2	00002	2	2	2		one	one	1902-02-02	1902	02:02:02	1902-02-02 02:02:02
select time_stamp>@now from t1;
time_stamp>@now
1
drop table t1;
+6 −2
Original line number Diff line number Diff line
@@ -237,13 +237,17 @@ grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
create view v1 as select * from mysqltest.t1;
alter view v1 as select * from mysqltest.t1;
ERROR 42000: DELETE command denied to user 'mysqltest_1'@'localhost' for table 'v1'
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 'v1'
create or replace view v1 as select * from mysqltest.t1;
ERROR 42000: DELETE command denied to user 'mysqltest_1'@'localhost' for table 'v1'
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 'v1'
create view mysqltest.v2  as select * from mysqltest.t1;
ERROR 42000: CREATE VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v2'
create view v2 as select * from mysqltest.t2;
ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2'
grant create view,drop,select on test.* to mysqltest_1@localhost;
use test;
alter view v1 as select * from mysqltest.t1;
create or replace view v1 as select * from mysqltest.t1;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
revoke all privileges on test.* from mysqltest_1@localhost;
drop database mysqltest;
Loading