1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-04 06:05:05 +03:00
mleich@five.local.lan 30091e23f9 WL#4203 Reorganize and fix the data dictionary tests of
testsuite funcs_1
1. Fix the following bugs
   Bug#30440 "datadict" tests (all engines) fail: Character sets depend on configuration
      Solution: Test variants charset_collation_* adjusted to different builds
   Bug#32603 "datadict" tests (all engines) fail in "community" tree: "PROFILING" table
      Solution: Excluding "PROFILING" table from queries
   Bug#33654 "slow log" is missing a line
      Solution: Unify the content of the fields TABLES.TABLE_ROWS and
                STATISTICS.CARDINALITY within result sets
   Bug#34532 Some funcs_1 tests do not clean up at end of testing
      Solution: DROP objects/reset global server variables modified during testing
                + let tests missing implementation end before loading of tables
   Bug#31421 funcs_1: ndb__datadict fails, discrepancy between scripts and expected results
      Solution: Cut <engine>__datadict tests into smaller tests + generate new results.
   Bug#33599 INFORMATION_SCHEMA.STATISTICS got a new column INDEX_COMMENT: tests fail (2)
      Generation of new results during post merge fix
   Bug#33600 CHARACTER_OCTET_LENGTH is now CHARACTER_MAXIMUM_LENGTH * 4
      Generation of new results during post merge fix
   Bug#33631 Platform-specific replace of CHARACTER_MAXIMUM_LENGTH broken by 4-byte encoding
      Generation of new results during post merge fix
      + removal of platform-specific replace routine (no more needed)
2. Restructure the tests
   - Test not more than one INFORMATION_SCHEMA view per testscript
   - Separate tests of I_S view layout+functionality from content related to the
     all time existing databases "information_schema", "mysql" and "test"
   - Avoid storage engine related variants of tests which are not sensible to
     storage engines at all.
3. Reimplement or add some subtests + cleanup
   There is a some probability that even the reviewed changeset
   - does not fix all bugs from above   or
   - contains new bugs which show up on some platforms <> Linux or on one of
     the various build types
4. The changeset contains fixes according to
   - one code review
   - minor bugs within testing code found after code review (accepted by reviewer)
   - problems found during tests with 5.0.56 in build environment
2008-03-07 17:33:07 +01:00

119 lines
5.1 KiB
SQL

#### suite/funcs_1/storedproc/storedproc_08.inc
#
--source suite/funcs_1/storedproc/load_sp_tb.inc
# ==============================================================================
# (numbering from requirement document TP v1.0, Last updated: 25 Jan 2005 01:00)
#
# 3.1.8 SHOW statement checks:
#
#- 1. Ensure that the definition of a procedure is properly recorded and displayed when a SHOW CREATE PROCEDURE or SHOW CREATE PROCEDURE STATUS statement is executed.
#- 2. Ensure that the definition of a procedure is not displayed when a SHOW CREATE FUNCTION or SHOW CREATE FUNCTION STATUS statement is executed.
#- 3. Ensure that an attempt to execute SHOW CREATE PROCEDURE or SHOW CREATE PROCEDURE STATUS, with the name of a non-existent procedure, fails with an appropriate error message.
#- 4. Ensure that an attempt to execute SHOW CREATE PROCEDURE or SHOW CREATE PROCEDURE STATUS, with the name of a function, fails with an appropriate error message.
#- 5. Ensure that the definition of a function is properly recorded and displayed when a SHOW CREATE FUNCTION or SHOW CREATE FUNCTION STATUS statement is executed.
#- 6. Ensure that the definition of a function is not displayed when a SHOW CREATE PROCEDURE or SHOW CREATE PROCEDURE STATUS statement is executed.
#- 7. Ensure that an attempt to execute SHOW CREATE FUNCTION or SHOW CREATE FUNCTION STATUS, with the name of a non-existent function, fails with an appropriate error message.
#- 8. Ensure that an attempt to execute SHOW CREATE FUNCTION or SHOW CREATE FUNCTION STATUS, with the name of a procedure, fails with an appropriate error message.
## 9. Ensure that all stored procedure changes made with ALTER PROCEDURE or ALTER FUNCTION are properly recorded and displayed when a SHOW CREATE PROCEDURE or SHOW CREATE PROCEDURE STATUS statement, or a SHOW CREATE FUNCTION or SHOW CREATE FUNCTION STATUS statement (respectively) is executed.
#- 10. Ensure that, when a stored procedure is dropped, its definition no longer appears when a SHOW CREATE PROCEDURE or SHOW CREATE PROCEDURE STATUS statement, or a SHOW CREATE FUNCTION or SHOW CREATE FUNCTION STATUS statement (respectively) is executed.
#
# ==============================================================================
let $message= Section 3.1.8 - SHOW statement checks:;
--source include/show_msg80.inc
# ------------------------------------------------------------------------------
let $message= Testcase 3.1.8.9:;
--source include/show_msg.inc
let $message=
Ensure that all stored procedure changes made with ALTER PROCEDURE or ALTER
FUNCTION are properly recorded and displayed when a SHOW CREATE PROCEDURE or
SHOW CREATE PROCEDURE STATUS statement, or a SHOW CREATE FUNCTION or SHOW CREATE
FUNCTION STATUS statement (respectively) is executed.;
--source include/show_msg80.inc
--disable_warnings
DROP FUNCTION IF EXISTS fn_1;
DROP FUNCTION IF EXISTS fn_2;
DROP PROCEDURE IF EXISTS sp_1;
DROP PROCEDURE IF EXISTS sp_2;
--enable_warnings
delimiter //;
CREATE PROCEDURE sp_1 (i1 int)
BEGIN
set @x=i1;
END//
CREATE PROCEDURE sp_2 (i1 int) SQL SECURITY INVOKER COMMENT 'created with INVOKER'
BEGIN
set @x=i1;
END//
CREATE FUNCTION fn_1 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) returns year
BEGIN
set @x=i1;
set @y=@x;
return i4;
END//
CREATE FUNCTION fn_2 (i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real)
RETURNS YEAR
SQL SECURITY INVOKER
COMMENT 'created with INVOKER'
BEGIN
set @x=i1;
set @y=@x;
return i4;
END//
delimiter ;//
--source suite/funcs_1/storedproc/storedproc_08_show.inc
let $message= ... now change some stuff:;
--source include/show_msg.inc
# some of the changes might be 'strange' here, but they are used here ONLY to
# check that the changes are recorded / showd correct
ALTER PROCEDURE sp_1 SQL SECURITY INVOKER;
ALTER PROCEDURE sp_1 COMMENT 'new comment, SP changed to INVOKER';
ALTER PROCEDURE sp_2 SQL SECURITY DEFINER;
ALTER PROCEDURE sp_2 DROP COMMENT;
ALTER PROCEDURE sp_2 COMMENT 'SP changed to DEFINER';
ALTER PROCEDURE sp_2 READS SQL DATA;
ALTER FUNCTION fn_1 SQL SECURITY INVOKER;
ALTER FUNCTION fn_1 COMMENT 'new comment, FN changed to INVOKER';
ALTER FUNCTION fn_1 NO SQL;
ALTER FUNCTION fn_2 SQL SECURITY DEFINER;
ALTER FUNCTION fn_2 COMMENT 'FN changed to DEFINER';
ALTER FUNCTION fn_2 MODIFIES SQL DATA;
--source suite/funcs_1/storedproc/storedproc_08_show.inc
let $message= ... change back to default and check result:;
--source include/show_msg.inc
ALTER FUNCTION fn_2 CONTAINS SQL;
--source suite/funcs_1/storedproc/storedproc_08_show.inc
# cleanup 3.1.8.9
let $message= ... cleanup;
--source include/show_msg.inc
DROP FUNCTION fn_1;
DROP FUNCTION fn_2;
DROP PROCEDURE sp_1;
# ==============================================================================
# USE the same .inc to cleanup before and after the test
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
# ==============================================================================
let $message= . +++ END OF SCRIPT +++;
--source include/show_msg80.inc
# ==============================================================================