| 1 |
## Drop view |
| 2 |
|
| 3 |
## Preamble |
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/xplugin_create_user.inc |
| 6 |
|
| 7 |
## Test data |
| 8 |
## Test starts here |
| 9 |
--let $xtest_file= $MYSQL_TMP_DIR/create_view.xpl |
| 10 |
--write_file $xtest_file |
| 11 |
-->quiet |
| 12 |
|
| 13 |
-->macro Drop_view %OPTION% %ERROR% |
| 14 |
Mysqlx.Crud.DropView { |
| 15 |
collection { name: "xview" schema: "xtest" } |
| 16 |
%OPTION% |
| 17 |
} |
| 18 |
-->recvuntil %ERROR% |
| 19 |
-->endmacro |
| 20 |
|
| 21 |
|
| 22 |
-->title -Drop view (success) |
| 23 |
-->callmacro Drop_view # Mysqlx.Ok |
| 24 |
|
| 25 |
|
| 26 |
-->title -Drop view (error: view removed) |
| 27 |
-->callmacro Drop_view # Mysqlx.Error |
| 28 |
|
| 29 |
|
| 30 |
-->title -Drop view (if exists) |
| 31 |
-->callmacro Drop_view if_exists: true Mysqlx.Ok |
| 32 |
|
| 33 |
|
| 34 |
-->stmtsql SHOW STATUS LIKE 'Mysqlx_crud_drop_view' |
| 35 |
-->recvresult |
| 36 |
|
| 37 |
EOF |
| 38 |
|
| 39 |
|
| 40 |
CREATE SCHEMA xtest; |
| 41 |
CREATE TABLE xtest.xtable (first INT, second JSON); |
| 42 |
CREATE VIEW xtest.xview AS SELECT first FROM xtest.xtable; |
| 43 |
SHOW CREATE VIEW xtest.xview; |
| 44 |
|
| 45 |
--exec $MYSQLXTEST -ux_root --password='' --file=$xtest_file 2>&1 |
| 46 |
|
| 47 |
--let $assert_text= Global status of 'Mysqlx_crud_drop_view' |
| 48 |
--let $assert_cond= [SHOW GLOBAL STATUS LIKE \'Mysqlx_crud_drop_view\', Value, 1] = 3 |
| 49 |
--source include/assert.inc |
| 50 |
|
| 51 |
## Cleanup |
| 52 |
--source ../include/xplugin_cleanup.inc |