mariadb/mysql-test/suite/partitions/include/partition_trigg2.inc
unknown ee5eb8bbe1 copy from test-extra-5.1 to main tree
BitKeeper/etc/ignore:
  Added mysql-test/suite/funcs_1/r/innodb_views.warnings mysql-test/suite/funcs_1/r/memory_trig_03e.warnings mysql-test/suite/funcs_1/r/memory_views.warnings mysql-test/suite/funcs_1/r/myisam_trig_03e.warnings mysql-test/suite/funcs_1/r/myisam_views.warnings mysql-test/suite/funcs_1/r/ndb_trig_03e.warnings mysql-test/suite/funcs_1/r/ndb_views.warnings mysql-test/suite/partitions/r/diff mysql-test/suite/partitions/r/partition_bit_ndb.warnings mysql-test/suite/partitions/r/partition_special_innodb.warnings mysql-test/suite/partitions/r/partition_special_myisam.warnings storage/archive/archive_reader mysql-test/suite/funcs_1/r/innodb_trig_03e.warnings to the ignore list
mysql-test/suite/funcs_2/include/check_charset.inc:
  inserted newline at the end of file.
mysql-test/suite/objects/include/drop_all.inc:
  inserted newline at the end of file.
mysql-test/suite/partitions/include/partition_key_32col.inc:
  inserted newline at the end of file.
mysql-test/suite/rpl/data/rpl_mixed.dat:
  inserted newline at the end of file.
mysql-test/suite/rpl/include/rpl_mixed_check_event.inc:
  inserted newline at the end of file.
mysql-test/suite/rpl/include/rpl_mixed_check_select.inc:
  inserted newline at the end of file.
mysql-test/suite/rpl/include/rpl_mixed_check_user.inc:
  inserted newline at the end of file.
mysql-test/suite/rpl/include/rpl_mixed_check_view.inc:
  inserted newline at the end of file.
2007-02-06 13:35:54 +01:00

45 lines
2.4 KiB
PHP

################################################################################
# include/partition_trigg2.inc #
# #
# Purpose: #
# Auxiliary script, only useful when sourced by include/partition_check.inc. #
# The trigger uses new values (--> event UPDATE, INSERT only) #
# #
# 1. Create a trigger #
# 2. Execute a statement, which activates the trigger #
# 3. Check the results of the trigger activity #
# 4. Revert the modifications #
# #
#------------------------------------------------------------------------------#
# Original Author: ML #
# Original Date: 2006-03-05 #
# Change Author: #
# Change Date: #
# Change: #
################################################################################
delimiter |;
eval CREATE TRIGGER trg_2 $event ON t1 FOR EACH ROW
BEGIN
SET new.f_int1 = $source.f_int1 + @max_row,
new.f_int2 = $source.f_int2 - @max_row,
new.f_charbig = '####updated per update trigger####';
END|
delimiter ;|
eval $statement;
# Check of preceeding statement via Select
if ($no_debug)
{
--disable_query_log
}
eval SELECT '# check trigger-$num success: ' AS "", COUNT(*) = 0 AS "" FROM t1
WHERE f_int1 - CAST(f_char1 AS SIGNED INT) NOT IN (@max_row, 2 * @max_row)
OR f_int2 - CAST(f_char1 AS SIGNED INT) NOT IN (-@max_row, - 2 * @max_row)
OR f_charbig <> '####updated per update trigger####';
--enable_query_log
DROP TRIGGER trg_2;
# Revert the changes
eval UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT),
f_int2 = CAST(f_char1 AS SIGNED INT),
f_charbig = CONCAT('===',f_char1,'===');
inc $num;