| 1 |
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; |
| 2 |
|
| 3 |
--source suite/funcs_1/storedproc/load_sp_tb.inc |
| 4 |
-------------------------------------------------------------------------------- |
| 5 |
SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; |
| 6 |
|
| 7 |
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc |
| 8 |
-------------------------------------------------------------------------------- |
| 9 |
DROP DATABASE IF EXISTS db_storedproc; |
| 10 |
DROP DATABASE IF EXISTS db_storedproc_1; |
| 11 |
CREATE DATABASE db_storedproc charset utf8mb4; |
| 12 |
CREATE DATABASE db_storedproc_1 charset utf8mb4; |
| 13 |
USE db_storedproc; |
| 14 |
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) |
| 15 |
engine = <engine_to_be_tested>; |
| 16 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t1; |
| 17 |
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) |
| 18 |
engine = <engine_to_be_tested>; |
| 19 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t2; |
| 20 |
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>; |
| 21 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t3.txt' into table t3; |
| 22 |
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) |
| 23 |
engine = <engine_to_be_tested>; |
| 24 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t4; |
| 25 |
USE db_storedproc_1; |
| 26 |
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) |
| 27 |
engine = <engine_to_be_tested>; |
| 28 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t6; |
| 29 |
USE db_storedproc; |
| 30 |
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) |
| 31 |
engine = <engine_to_be_tested>; |
| 32 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t7; |
| 33 |
Warnings: |
| 34 |
Warning 1265 Data truncated for column 'f3' at row 1 |
| 35 |
Warning 1265 Data truncated for column 'f3' at row 2 |
| 36 |
Warning 1265 Data truncated for column 'f3' at row 3 |
| 37 |
Warning 1265 Data truncated for column 'f3' at row 4 |
| 38 |
Warning 1265 Data truncated for column 'f3' at row 5 |
| 39 |
Warning 1265 Data truncated for column 'f3' at row 6 |
| 40 |
Warning 1265 Data truncated for column 'f3' at row 7 |
| 41 |
Warning 1265 Data truncated for column 'f3' at row 8 |
| 42 |
Warning 1265 Data truncated for column 'f3' at row 9 |
| 43 |
Warning 1265 Data truncated for column 'f3' at row 10 |
| 44 |
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) |
| 45 |
engine = <engine_to_be_tested>; |
| 46 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t7.txt' into table t8; |
| 47 |
Warnings: |
| 48 |
Warning 1265 Data truncated for column 'f3' at row 1 |
| 49 |
Warning 1265 Data truncated for column 'f3' at row 2 |
| 50 |
Warning 1265 Data truncated for column 'f3' at row 3 |
| 51 |
Warning 1265 Data truncated for column 'f3' at row 4 |
| 52 |
Warning 1265 Data truncated for column 'f3' at row 5 |
| 53 |
Warning 1265 Data truncated for column 'f3' at row 6 |
| 54 |
Warning 1265 Data truncated for column 'f3' at row 7 |
| 55 |
Warning 1265 Data truncated for column 'f3' at row 8 |
| 56 |
Warning 1265 Data truncated for column 'f3' at row 9 |
| 57 |
Warning 1265 Data truncated for column 'f3' at row 10 |
| 58 |
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>; |
| 59 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' into table t9; |
| 60 |
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) |
| 61 |
engine = <engine_to_be_tested>; |
| 62 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t10; |
| 63 |
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) |
| 64 |
engine = <engine_to_be_tested>; |
| 65 |
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11; |
| 66 |
SET sql_mode = default; |
| 67 |
Warnings: |
| 68 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 69 |
|
| 70 |
Section 3.1.10 - CALL checks: |
| 71 |
-------------------------------------------------------------------------------- |
| 72 |
Warnings: |
| 73 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 74 |
USE db_storedproc; |
| 75 |
Warnings: |
| 76 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 77 |
|
| 78 |
Testcase 3.1.10.2 + 3.1.10.5: |
| 79 |
----------------------------- |
| 80 |
Warnings: |
| 81 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 82 |
Warnings: |
| 83 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 84 |
|
| 85 |
2. Ensure that a procedure cannot be called if the appropriate privileges do not |
| 86 |
exist. |
| 87 |
5. Ensure that a function cannot be executed if the appropriate privileges do |
| 88 |
not exist. |
| 89 |
-------------------------------------------------------------------------------- |
| 90 |
Warnings: |
| 91 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 92 |
DROP PROCEDURE IF EXISTS sp31102; |
| 93 |
DROP FUNCTION IF EXISTS fn31105; |
| 94 |
create user 'user_1'@'localhost'; |
| 95 |
create user 'user_2'@'localhost'; |
| 96 |
GRANT CREATE ROUTINE ON db_storedproc.* TO 'user_1'@'localhost'; |
| 97 |
GRANT SELECT ON db_storedproc.* TO 'user_2'@'localhost'; |
| 98 |
FLUSH PRIVILEGES; |
| 99 |
|
| 100 |
user_1@localhost db_storedproc |
| 101 |
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER |
| 102 |
BEGIN |
| 103 |
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1; |
| 104 |
END// |
| 105 |
CREATE FUNCTION fn31105(n INT) RETURNS INT |
| 106 |
BEGIN |
| 107 |
DECLARE res INT; |
| 108 |
SET res = n * n; |
| 109 |
RETURN res; |
| 110 |
END// |
| 111 |
|
| 112 |
user_2@localhost db_storedproc |
| 113 |
CALL sp31102(); |
| 114 |
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' |
| 115 |
SELECT fn31105( 9 ); |
| 116 |
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' |
| 117 |
connection default; |
| 118 |
USE db_storedproc; |
| 119 |
|
| 120 |
root@localhost db_storedproc |
| 121 |
CALL sp31102(); |
| 122 |
f1 f2 f3 f4 f5 f6 |
| 123 |
a` a` 1000-01-01 -5000 a` -5000 |
| 124 |
SELECT fn31105( 9 ); |
| 125 |
fn31105( 9 ) |
| 126 |
81 |
| 127 |
GRANT EXECUTE ON db_storedproc.* TO 'user_2'@'localhost'; |
| 128 |
FLUSH PRIVILEGES; |
| 129 |
|
| 130 |
user_2@localhost db_storedproc |
| 131 |
CALL sp31102(); |
| 132 |
f1 f2 f3 f4 f5 f6 |
| 133 |
a` a` 1000-01-01 -5000 a` -5000 |
| 134 |
SELECT fn31105( 9 ); |
| 135 |
fn31105( 9 ) |
| 136 |
81 |
| 137 |
connection default; |
| 138 |
USE db_storedproc; |
| 139 |
|
| 140 |
root@localhost db_storedproc |
| 141 |
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost'; |
| 142 |
FLUSH PRIVILEGES; |
| 143 |
CALL sp31102(); |
| 144 |
f1 f2 f3 f4 f5 f6 |
| 145 |
a` a` 1000-01-01 -5000 a` -5000 |
| 146 |
SELECT fn31105( 9 ); |
| 147 |
fn31105( 9 ) |
| 148 |
81 |
| 149 |
|
| 150 |
user_2@localhost db_storedproc |
| 151 |
CALL sp31102(); |
| 152 |
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102' |
| 153 |
SELECT fn31105( 9 ); |
| 154 |
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105' |
| 155 |
USE db_storedproc; |
| 156 |
|
| 157 |
root@localhost db_storedproc |
| 158 |
DROP PROCEDURE sp31102; |
| 159 |
DROP FUNCTION fn31105; |
| 160 |
DROP USER 'user_1'@'localhost'; |
| 161 |
DROP USER 'user_2'@'localhost'; |
| 162 |
Warnings: |
| 163 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 164 |
|
| 165 |
Testcase 3.1.10.3: |
| 166 |
------------------ |
| 167 |
Warnings: |
| 168 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 169 |
Warnings: |
| 170 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 171 |
|
| 172 |
Ensure that a function can never be called. |
| 173 |
-------------------------------------------------------------------------------- |
| 174 |
Warnings: |
| 175 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 176 |
DROP FUNCTION IF EXISTS fn1; |
| 177 |
CREATE FUNCTION fn1(a int) returns int |
| 178 |
BEGIN |
| 179 |
set @b = 0.9 * a; |
| 180 |
return @b; |
| 181 |
END// |
| 182 |
CALL fn1(); |
| 183 |
ERROR 42000: PROCEDURE db_storedproc.fn1 does not exist |
| 184 |
DROP FUNCTION fn1; |
| 185 |
Warnings: |
| 186 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 187 |
|
| 188 |
Testcase 3.1.10.6: |
| 189 |
------------------ |
| 190 |
Warnings: |
| 191 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 192 |
Warnings: |
| 193 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 194 |
|
| 195 |
Ensure that a procedure can never be executed. |
| 196 |
-------------------------------------------------------------------------------- |
| 197 |
Warnings: |
| 198 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 199 |
DROP PROCEDURE IF EXISTS sp1; |
| 200 |
DROP FUNCTION IF EXISTS sp1; |
| 201 |
CREATE PROCEDURE sp1() |
| 202 |
BEGIN |
| 203 |
SELECT * from t10; |
| 204 |
END// |
| 205 |
SELECT sp1(); |
| 206 |
ERROR 42000: FUNCTION db_storedproc.sp1 does not exist |
| 207 |
DROP PROCEDURE sp1; |
| 208 |
Warnings: |
| 209 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 210 |
|
| 211 |
Testcase 3.1.10.7: |
| 212 |
------------------ |
| 213 |
Warnings: |
| 214 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 215 |
Warnings: |
| 216 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 217 |
|
| 218 |
Ensure that the ROW_COUNT() SQL function always returns the correct number of |
| 219 |
rows affected by the execution of a stored procedure. |
| 220 |
-------------------------------------------------------------------------------- |
| 221 |
Warnings: |
| 222 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 223 |
DROP PROCEDURE IF EXISTS sp_ins_1; |
| 224 |
DROP PROCEDURE IF EXISTS sp_ins_3; |
| 225 |
DROP PROCEDURE IF EXISTS sp_upd; |
| 226 |
DROP PROCEDURE IF EXISTS sp_ins_upd; |
| 227 |
DROP PROCEDURE IF EXISTS sp_del; |
| 228 |
DROP PROCEDURE IF EXISTS sp_with_rowcount; |
| 229 |
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT); |
| 230 |
INSERT INTO temp SELECT * FROM t10; |
| 231 |
CREATE PROCEDURE sp_ins_1() |
| 232 |
BEGIN |
| 233 |
INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000); |
| 234 |
END// |
| 235 |
CREATE PROCEDURE sp_ins_3() |
| 236 |
BEGIN |
| 237 |
INSERT INTO temp VALUES ('abc', 'xyz', '19490523', 100, 'uvw', 1000); |
| 238 |
INSERT INTO temp VALUES ('abc', 'xyz', '1989-11-09', 100, 'uvw', 1000); |
| 239 |
INSERT INTO temp VALUES ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000); |
| 240 |
END// |
| 241 |
CREATE PROCEDURE sp_upd() |
| 242 |
BEGIN |
| 243 |
UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc'; |
| 244 |
END// |
| 245 |
CREATE PROCEDURE sp_ins_upd() |
| 246 |
BEGIN |
| 247 |
BEGIN |
| 248 |
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000); |
| 249 |
INSERT INTO temp VALUES ('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000); |
| 250 |
INSERT INTO temp VALUES ('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000); |
| 251 |
INSERT INTO temp VALUES ('qwe', 'abc', '2005-11-07', 100, 'uvw', 1000); |
| 252 |
END; |
| 253 |
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1; |
| 254 |
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc'; |
| 255 |
END// |
| 256 |
CREATE PROCEDURE sp_del() |
| 257 |
BEGIN |
| 258 |
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2'; |
| 259 |
END// |
| 260 |
CREATE PROCEDURE sp_with_rowcount() |
| 261 |
BEGIN |
| 262 |
BEGIN |
| 263 |
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000), |
| 264 |
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000), |
| 265 |
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000), |
| 266 |
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000); |
| 267 |
END; |
| 268 |
SELECT row_count() AS 'row_count() after insert'; |
| 269 |
SELECT row_count() AS 'row_count() after select row_count()'; |
| 270 |
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3; |
| 271 |
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc'; |
| 272 |
SELECT row_count() AS 'row_count() after update'; |
| 273 |
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3; |
| 274 |
DELETE FROM temp WHERE temp.f1 = 'updated_2'; |
| 275 |
SELECT row_count() AS 'row_count() after delete'; |
| 276 |
END// |
| 277 |
CALL sp_ins_1(); |
| 278 |
SELECT row_count(); |
| 279 |
row_count() |
| 280 |
1 |
| 281 |
SELECT * FROM temp; |
| 282 |
f1 f2 f3 f4 f5 f6 |
| 283 |
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992 |
| 284 |
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991 |
| 285 |
a` a` 1000-01-01 -5000 a` -5000 |
| 286 |
aaa aaa 1000-01-02 -4999 aaa -4999 |
| 287 |
abaa abaa 1000-01-03 -4998 abaa -4998 |
| 288 |
abc abc 2005-10-03 100 uvw 1000 |
| 289 |
acaaa acaaa 1000-01-04 -4997 acaaa -4997 |
| 290 |
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996 |
| 291 |
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995 |
| 292 |
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994 |
| 293 |
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993 |
| 294 |
CALL sp_ins_3(); |
| 295 |
SELECT row_count(); |
| 296 |
row_count() |
| 297 |
1 |
| 298 |
SELECT * FROM temp; |
| 299 |
f1 f2 f3 f4 f5 f6 |
| 300 |
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992 |
| 301 |
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991 |
| 302 |
a` a` 1000-01-01 -5000 a` -5000 |
| 303 |
aaa aaa 1000-01-02 -4999 aaa -4999 |
| 304 |
abaa abaa 1000-01-03 -4998 abaa -4998 |
| 305 |
abc abc 2005-10-03 100 uvw 1000 |
| 306 |
abc xyz 1949-05-23 100 uvw 1000 |
| 307 |
abc xyz 1989-11-09 100 uvw 1000 |
| 308 |
abc xyz 2005-10-24 100 uvw 1000 |
| 309 |
acaaa acaaa 1000-01-04 -4997 acaaa -4997 |
| 310 |
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996 |
| 311 |
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995 |
| 312 |
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994 |
| 313 |
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993 |
| 314 |
CALL sp_upd(); |
| 315 |
SELECT row_count(); |
| 316 |
row_count() |
| 317 |
4 |
| 318 |
SELECT * FROM temp; |
| 319 |
f1 f2 f3 f4 f5 f6 |
| 320 |
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992 |
| 321 |
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991 |
| 322 |
a` a` 1000-01-01 -5000 a` -5000 |
| 323 |
aaa aaa 1000-01-02 -4999 aaa -4999 |
| 324 |
abaa abaa 1000-01-03 -4998 abaa -4998 |
| 325 |
acaaa acaaa 1000-01-04 -4997 acaaa -4997 |
| 326 |
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996 |
| 327 |
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995 |
| 328 |
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994 |
| 329 |
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993 |
| 330 |
updated abc 2005-10-03 100 uvw 1000 |
| 331 |
updated xyz 1949-05-23 100 uvw 1000 |
| 332 |
updated xyz 1989-11-09 100 uvw 1000 |
| 333 |
updated xyz 2005-10-24 100 uvw 1000 |
| 334 |
CALL sp_ins_upd(); |
| 335 |
COUNT( f1 ) f1 |
| 336 |
1 a` |
| 337 |
1 aaa |
| 338 |
1 abaa |
| 339 |
1 acaaa |
| 340 |
1 adaaaa |
| 341 |
1 aeaaaaa |
| 342 |
1 afaaaaaa |
| 343 |
1 agaaaaaaa |
| 344 |
1 a^aaaaaaaa |
| 345 |
1 a_aaaaaaaaa |
| 346 |
4 updated |
| 347 |
4 qwe |
| 348 |
SELECT row_count(); |
| 349 |
row_count() |
| 350 |
3 |
| 351 |
SELECT * FROM temp; |
| 352 |
f1 f2 f3 f4 f5 f6 |
| 353 |
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992 |
| 354 |
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991 |
| 355 |
a` a` 1000-01-01 -5000 a` -5000 |
| 356 |
aaa aaa 1000-01-02 -4999 aaa -4999 |
| 357 |
abaa abaa 1000-01-03 -4998 abaa -4998 |
| 358 |
acaaa acaaa 1000-01-04 -4997 acaaa -4997 |
| 359 |
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996 |
| 360 |
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995 |
| 361 |
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994 |
| 362 |
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993 |
| 363 |
qwe xyz 1998-03-26 100 uvw 1000 |
| 364 |
updated abc 2005-10-03 100 uvw 1000 |
| 365 |
updated xyz 1949-05-23 100 uvw 1000 |
| 366 |
updated xyz 1989-11-09 100 uvw 1000 |
| 367 |
updated xyz 2005-10-24 100 uvw 1000 |
| 368 |
updated_2 abc 1989-11-09 100 uvw 1000 |
| 369 |
updated_2 abc 2000-11-09 100 uvw 1000 |
| 370 |
updated_2 abc 2005-11-07 100 uvw 1000 |
| 371 |
CALL sp_del(); |
| 372 |
SELECT row_count(); |
| 373 |
row_count() |
| 374 |
4 |
| 375 |
SELECT * FROM temp; |
| 376 |
f1 f2 f3 f4 f5 f6 |
| 377 |
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992 |
| 378 |
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991 |
| 379 |
a` a` 1000-01-01 -5000 a` -5000 |
| 380 |
aaa aaa 1000-01-02 -4999 aaa -4999 |
| 381 |
abaa abaa 1000-01-03 -4998 abaa -4998 |
| 382 |
acaaa acaaa 1000-01-04 -4997 acaaa -4997 |
| 383 |
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996 |
| 384 |
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995 |
| 385 |
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994 |
| 386 |
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993 |
| 387 |
updated abc 2005-10-03 100 uvw 1000 |
| 388 |
updated xyz 1949-05-23 100 uvw 1000 |
| 389 |
updated xyz 1989-11-09 100 uvw 1000 |
| 390 |
updated xyz 2005-10-24 100 uvw 1000 |
| 391 |
DELETE FROM temp; |
| 392 |
CALL sp_with_rowcount(); |
| 393 |
row_count() after insert |
| 394 |
4 |
| 395 |
row_count() after select row_count() |
| 396 |
-1 |
| 397 |
f1 f2 f3 |
| 398 |
qwe abc 1989-11-09 |
| 399 |
qwe abc 2000-11-09 |
| 400 |
qwe xyz 1998-03-26 |
| 401 |
qwe xyz 2005-11-07 |
| 402 |
row_count() after update |
| 403 |
2 |
| 404 |
f1 f2 f3 |
| 405 |
qwe xyz 1998-03-26 |
| 406 |
qwe xyz 2005-11-07 |
| 407 |
updated_2 abc 1989-11-09 |
| 408 |
updated_2 abc 2000-11-09 |
| 409 |
row_count() after delete |
| 410 |
2 |
| 411 |
SELECT row_count(); |
| 412 |
row_count() |
| 413 |
0 |
| 414 |
SELECT * FROM temp; |
| 415 |
f1 f2 f3 f4 f5 f6 |
| 416 |
qwe xyz 1998-03-26 100 uvw 1000 |
| 417 |
qwe xyz 2005-11-07 100 uvw 1000 |
| 418 |
DROP PROCEDURE sp_ins_1; |
| 419 |
DROP PROCEDURE sp_ins_3; |
| 420 |
DROP PROCEDURE sp_upd; |
| 421 |
DROP PROCEDURE sp_ins_upd; |
| 422 |
DROP PROCEDURE sp_del; |
| 423 |
DROP PROCEDURE sp_with_rowcount; |
| 424 |
DROP TABLE temp; |
| 425 |
Warnings: |
| 426 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 427 |
|
| 428 |
Testcase 3.1.10.8: |
| 429 |
------------------ |
| 430 |
Warnings: |
| 431 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 432 |
Warnings: |
| 433 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 434 |
|
| 435 |
Ensure that the mysql_affected_rows() C API function always returns the correct |
| 436 |
number of rows affected by the execution of a stored procedure. |
| 437 |
-------------------------------------------------------------------------------- |
| 438 |
Warnings: |
| 439 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 440 |
|
| 441 |
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc |
| 442 |
-------------------------------------------------------------------------------- |
| 443 |
DROP DATABASE IF EXISTS db_storedproc; |
| 444 |
DROP DATABASE IF EXISTS db_storedproc_1; |
| 445 |
|
| 446 |
. +++ END OF SCRIPT +++ |
| 447 |
-------------------------------------------------------------------------------- |