mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
225330cd5b
into mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new mysql-test/r/innodb.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/timezone_grant.result: Auto merged mysql-test/r/trigger.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/innodb.test: Auto merged mysql-test/t/sp.test: Auto merged mysql-test/t/trigger.test: Auto merged mysql-test/t/view.test: Auto merged sql/lex.h: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_view.cc: Auto merged mysql-test/r/rpl_insert_id.result: Manual merge. mysql-test/t/disabled.def: Manual merge. mysql-test/t/rpl_insert_id.test: Manual merge. sql/item_func.cc: Manual merge. sql/sql_yacc.yy: Manual merge - not complete yet.
78 lines
3.8 KiB
Text
78 lines
3.8 KiB
Text
drop tables if exists t1, t2;
|
|
drop view if exists v1;
|
|
delete from mysql.user where user like 'mysqltest\_%';
|
|
delete from mysql.db where user like 'mysqltest\_%';
|
|
delete from mysql.tables_priv where user like 'mysqltest\_%';
|
|
delete from mysql.columns_priv where user like 'mysqltest\_%';
|
|
flush privileges;
|
|
create table t1 (a int, b datetime);
|
|
create table t2 (c int, d datetime);
|
|
grant all privileges on test.* to mysqltest_1@localhost;
|
|
show grants for current_user();
|
|
Grants for mysqltest_1@localhost
|
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
|
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'localhost'
|
|
set time_zone= '+00:00';
|
|
set time_zone= 'Europe/Moscow';
|
|
select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC');
|
|
convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
|
|
2004-10-21 15:00:00
|
|
select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
|
|
convert_tz(b, 'Europe/Moscow', 'UTC')
|
|
update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC')
|
|
where t1.a = t2.c and t2.d = (select max(d) from t2);
|
|
select * from mysql.time_zone_name;
|
|
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
|
|
select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name;
|
|
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
|
|
delete from mysql.db where user like 'mysqltest\_%';
|
|
flush privileges;
|
|
grant all privileges on test.t1 to mysqltest_1@localhost;
|
|
grant all privileges on test.t2 to mysqltest_1@localhost;
|
|
show grants for current_user();
|
|
Grants for mysqltest_1@localhost
|
|
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
|
|
GRANT ALL PRIVILEGES ON `test`.`t2` TO 'mysqltest_1'@'localhost'
|
|
GRANT ALL PRIVILEGES ON `test`.`t1` TO 'mysqltest_1'@'localhost'
|
|
set time_zone= '+00:00';
|
|
set time_zone= 'Europe/Moscow';
|
|
select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC');
|
|
convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC')
|
|
NULL
|
|
Warnings:
|
|
Warning 1292 Incorrect datetime value: '2004-11-31 12:00:00'
|
|
select convert_tz(b, 'Europe/Moscow', 'UTC') from t1;
|
|
convert_tz(b, 'Europe/Moscow', 'UTC')
|
|
update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC')
|
|
where t1.a = t2.c and t2.d = (select max(d) from t2);
|
|
select * from mysql.time_zone_name;
|
|
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
|
|
select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name;
|
|
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
|
|
drop table t1, t2;
|
|
create table t1 (a int, b datetime);
|
|
create table t2 (a int, b varchar(40));
|
|
update t1 set b = '2005-01-01 10:00';
|
|
update t1 set b = convert_tz(b, 'UTC', 'UTC');
|
|
update t1 join t2 on (t1.a = t2.a) set t1.b = '2005-01-01 10:00' where t2.b = 'foo';
|
|
update t1 join t2 on (t1.a = t2.a) set t1.b = convert_tz('2005-01-01 10:00','UTC','UTC') where t2.b = 'foo';
|
|
delete from mysql.user where user like 'mysqltest\_%';
|
|
delete from mysql.db where user like 'mysqltest\_%';
|
|
delete from mysql.tables_priv where user like 'mysqltest\_%';
|
|
flush privileges;
|
|
drop table t1, t2;
|
|
create table t1 (a int, b datetime);
|
|
insert into t1 values (1, 20010101000000), (2, 20020101000000);
|
|
grant all privileges on test.* to mysqltest_1@localhost;
|
|
create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1;
|
|
select * from v1;
|
|
a lb
|
|
1 2001-01-01 03:00:00
|
|
2 2002-01-01 03:00:00
|
|
select * from v1, mysql.time_zone;
|
|
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone'
|
|
drop view v1;
|
|
create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1, mysql.time_zone;
|
|
ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 'time_zone'
|
|
drop table t1;
|
|
drop user mysqltest_1@localhost;
|