[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.116.20.205: ~ $
#======================================================================
#
# Trigger Tests
# test cases for TRIGGER privilege on db, table and column level
#======================================================================

--disable_abort_on_error

###########################################
################ Section 3.5.3 ############
# Check for Triggers in transactions      #
###########################################

# General setup to be used in all testcases
let $message= #########      Testcase for transactions:   ########;
--source include/show_msg.inc

        --disable_warnings
	drop database if exists priv_db;
	--enable_warnings
	create database priv_db;
	use priv_db;
	eval create table t1 (f1 char(20)) engine= $engine_type;

	create User test_yesprivs@localhost;
	set password for test_yesprivs@localhost = password('PWD');

	revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;

	connect (yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK);

	connection default;
        select current_user;
        grant  select, insert, update ,trigger
	        on priv_db.t1 to test_yesprivs@localhost;
	show grants for test_yesprivs@localhost;

	connection yes_privs;
        select current_user;
	use priv_db;
	set autocommit=0;
	create definer=current_user trigger trg1_1
		before INSERT on t1 for each row
		set new.f1 = 'trig 1_1-yes';
	rollback work;
	insert into t1 (f1) values ('insert-no');
	select f1 from t1 order by f1;

        create definer=test_yesprivs@localhost trigger trg1_2
                before UPDATE on t1 for each row
                set new.f1 = 'trig 1_2-yes';
	commit work;
        update t1 set f1 = 'update-yes' where f1 like '%trig%';
        select f1 from t1 order by f1;
	commit work;
	drop trigger trg1_1;
	rollback work;
	--error ER_TRG_DOES_NOT_EXIST
	drop trigger trg1_1;
	drop trigger trg1_2;
	commit work;
	set autocommit=1;

        connection default;
        select current_user;

# Cleanup prepare
	--disable_warnings
        disconnect yes_privs;

	connection default;
        select current_user;
	--enable_warnings


# general Cleanup
	--disable_warnings
	drop database if exists priv_db;
	drop user test_yesprivs@localhost;
	--enable_warnings


Filemanager

Name Type Size Permission Actions
trig_frkey.inc File 3.01 KB 0644
trig_frkey2.inc File 8.01 KB 0644
triggers_0102.inc File 15.96 KB 0644
triggers_03.inc File 19.03 KB 0644
triggers_03e_columns.inc File 7.68 KB 0644
triggers_03e_db_level.inc File 6.95 KB 0644
triggers_03e_db_table_mix.inc File 6.76 KB 0644
triggers_03e_definer.inc File 3.73 KB 0644
triggers_03e_global_db_mix.inc File 6.73 KB 0644
triggers_03e_prepare.inc File 5.38 KB 0644
triggers_03e_table_level.inc File 6.63 KB 0644
triggers_03e_transaction.inc File 2.19 KB 0644
triggers_0407.inc File 19.87 KB 0644
triggers_08.inc File 17.45 KB 0644
triggers_09.inc File 11.37 KB 0644
triggers_1011ext.inc File 13.93 KB 0644