Linux ip-172-26-2-223 5.4.0-1018-aws #18-Ubuntu SMP Wed Jun 24 01:15:00 UTC 2020 x86_64
Apache
: 172.26.2.223 | : 18.225.175.56
Cant Read [ /etc/named.conf ]
8.1.13
www
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
www /
server /
mysql /
mysql-test /
suite /
x /
t /
[ HOME SHELL ]
Name
Size
Permission
Action
macros
[ DIR ]
drwxr-xr-x
admin_bogus.test
600
B
-rw-r--r--
admin_bogus_mysqlx.test
597
B
-rw-r--r--
admin_create_collection.test
3.29
KB
-rw-r--r--
admin_create_collection_mysqlx...
2.67
KB
-rw-r--r--
admin_create_index_datetime.te...
5.15
KB
-rw-r--r--
admin_create_index_datetime_my...
2.6
KB
-rw-r--r--
admin_create_index_string.test
12.03
KB
-rw-r--r--
admin_create_index_string_mysq...
3.29
KB
-rw-r--r--
admin_ensure_collection.test
4.51
KB
-rw-r--r--
admin_ensure_collection_mysqlx...
3.7
KB
-rw-r--r--
admin_kill.test
2.36
KB
-rw-r--r--
admin_kill_client_mysqlx.test
1.69
KB
-rw-r--r--
admin_list_objects.test
2.57
KB
-rw-r--r--
admin_list_objects_case_insens...
577
B
-rw-r--r--
admin_list_objects_case_insens...
735
B
-rw-r--r--
admin_list_objects_case_sensit...
353
B
-rw-r--r--
admin_list_objects_case_sensit...
27
B
-rw-r--r--
admin_list_objects_case_sensit...
394
B
-rw-r--r--
admin_list_objects_mysqlx.test
2.59
KB
-rw-r--r--
admin_ping.test
484
B
-rw-r--r--
admin_ping_mysqlx.test
1.21
KB
-rw-r--r--
admin_xkill.test
44.87
KB
-rw-r--r--
binary_log-master.opt
110
B
-rw-r--r--
binary_log.test
1.2
KB
-rw-r--r--
bug_23028052.test
2.56
KB
-rw-r--r--
capabilities-master.opt
42
B
-rw-r--r--
capabilities.test
10.19
KB
-rw-r--r--
client_close.test
8.23
KB
-rw-r--r--
client_close_abort.test
1.93
KB
-rw-r--r--
client_session.test
1.61
KB
-rw-r--r--
connection.test
31.38
KB
-rw-r--r--
connection_default_schema.test
2.3
KB
-rw-r--r--
connection_expire.test
7.4
KB
-rw-r--r--
connection_expired_certs-maste...
167
B
-rw-r--r--
connection_expired_certs.test
677
B
-rw-r--r--
connection_ipv6-master.opt
35
B
-rw-r--r--
connection_ipv6.test
5.39
KB
-rw-r--r--
connection_nonssl-master.opt
42
B
-rw-r--r--
connection_nonssl.test
5.97
KB
-rw-r--r--
connection_openssl-master.opt
273
B
-rw-r--r--
connection_openssl.test
70
B
-rw-r--r--
connection_require_secure_tran...
2.77
KB
-rw-r--r--
connection_reset_by_peer.test
1.01
KB
-rw-r--r--
connection_skip_grant_table.te...
2.88
KB
-rw-r--r--
connection_skip_networking.tes...
3.21
KB
-rw-r--r--
connection_skip_networking_win...
57
B
-rw-r--r--
connection_skip_networking_win...
1.77
KB
-rw-r--r--
connection_timeout.test
2.72
KB
-rw-r--r--
connection_tls_version-master....
300
B
-rw-r--r--
connection_tls_version.test
4.47
KB
-rw-r--r--
connection_unixsocket.test
6.81
KB
-rw-r--r--
connection_unixsocket_invalid....
7.29
KB
-rw-r--r--
connection_unixsocket_lock.tes...
3.15
KB
-rw-r--r--
connection_unixsocket_rpl.test
7.17
KB
-rw-r--r--
connection_user_authentication...
89
B
-rw-r--r--
connection_user_authentication...
85
B
-rw-r--r--
connection_without_session.tes...
464
B
-rw-r--r--
connection_yassl-master.opt
272
B
-rw-r--r--
create_alter_sql.test
7.07
KB
-rw-r--r--
create_drop_collection_crud.te...
17.36
KB
-rw-r--r--
create_index_crud.test
23.75
KB
-rw-r--r--
crud_asterisk.test
1.65
KB
-rw-r--r--
crud_create_view-master.opt
31
B
-rw-r--r--
crud_create_view.test
5.47
KB
-rw-r--r--
crud_debug.test
6.46
KB
-rw-r--r--
crud_delete_args.test
2.16
KB
-rw-r--r--
crud_doc_criteria_args.test
21.18
KB
-rw-r--r--
crud_doc_expr_array.test
14.41
KB
-rw-r--r--
crud_doc_expr_object.test
6.69
KB
-rw-r--r--
crud_drop_view.test
1.12
KB
-rw-r--r--
crud_find_args.test
5.47
KB
-rw-r--r--
crud_find_doc_criteria.test
3.17
KB
-rw-r--r--
crud_find_doc_groupby.test
5.82
KB
-rw-r--r--
crud_find_groupby.test
8.13
KB
-rw-r--r--
crud_insert_args.test
2.01
KB
-rw-r--r--
crud_insert_cast.test
8.81
KB
-rw-r--r--
crud_insert_default.test
2.52
KB
-rw-r--r--
crud_insert_expr.test
2.66
KB
-rw-r--r--
crud_insert_nodoc.test
814
B
-rw-r--r--
crud_modify_view.test
2.4
KB
-rw-r--r--
crud_myisam_memory.test
9
KB
-rw-r--r--
crud_octets_content_type.test
2.35
KB
-rw-r--r--
crud_order_by.test
1.47
KB
-rw-r--r--
crud_pipe.test
4.18
KB
-rw-r--r--
crud_resultset_metadata.test
965
B
-rw-r--r--
crud_rpl.test
6.69
KB
-rw-r--r--
crud_sundries.test
20.07
KB
-rw-r--r--
crud_table_criteria_args.test
17.61
KB
-rw-r--r--
crud_table_expr_array.test
14.32
KB
-rw-r--r--
crud_table_expr_object.test
5.9
KB
-rw-r--r--
crud_update_args.test
3.37
KB
-rw-r--r--
crud_update_table_json.test
7.16
KB
-rw-r--r--
crud_view_sundries.test
2.95
KB
-rw-r--r--
delete_crud_1.test
6.81
KB
-rw-r--r--
delete_crud_o.test
23.94
KB
-rw-r--r--
delete_del_all.test
1.5
KB
-rw-r--r--
delete_del_bad_collection.test
1.98
KB
-rw-r--r--
delete_del_bad_expr.test
1.83
KB
-rw-r--r--
delete_del_missing_arg.test
1.81
KB
-rw-r--r--
delete_del_multi_by_expr.test
1.88
KB
-rw-r--r--
delete_del_multi_by_id.test
1.55
KB
-rw-r--r--
delete_del_none_by_expr.test
1.88
KB
-rw-r--r--
delete_del_none_table.test
2.41
KB
-rw-r--r--
delete_del_one_by_expr.test
2.38
KB
-rw-r--r--
delete_del_table.test
1.78
KB
-rw-r--r--
delete_del_table_doc.test
2.94
KB
-rw-r--r--
delete_del_table_order.test
2.32
KB
-rw-r--r--
delete_sql_o.test
7.77
KB
-rw-r--r--
disabled.def
259
B
-rw-r--r--
drop_index_crud.test
26.67
KB
-rw-r--r--
expect_noerror.test
5.51
KB
-rw-r--r--
fieldtypes_all.test
6.1
KB
-rw-r--r--
find_crud_conditionalclauses_o...
24.24
KB
-rw-r--r--
find_crud_groupby_o.test
16.22
KB
-rw-r--r--
find_doc_proj.test
8.52
KB
-rw-r--r--
find_doc_simple.test
5.28
KB
-rw-r--r--
find_docpath_expr.test
5.09
KB
-rw-r--r--
find_funtion_call.test
34.5
KB
-rw-r--r--
find_table_find.test
5.18
KB
-rw-r--r--
find_table_find_as_doc.test
4.5
KB
-rw-r--r--
find_table_find_rows_proj.test
5.3
KB
-rw-r--r--
forbidden_sql_cmd.test
1.28
KB
-rw-r--r--
input_queue.test
3.81
KB
-rw-r--r--
insert_crud_1.test
16.11
KB
-rw-r--r--
insert_crud_o.test
25.09
KB
-rw-r--r--
insert_doc_bad_proj.test
1.79
KB
-rw-r--r--
insert_doc_id.test
1.74
KB
-rw-r--r--
insert_doc_id_dup.test
2.61
KB
-rw-r--r--
insert_doc_noid.test
1.72
KB
-rw-r--r--
insert_sql_o.test
5.24
KB
-rw-r--r--
insert_table.test
8.29
KB
-rw-r--r--
insert_table_bad_column.test
2.27
KB
-rw-r--r--
insert_table_bad_column_type.t...
5.1
KB
-rw-r--r--
insert_table_bad_numcolumns.te...
5.39
KB
-rw-r--r--
insert_table_escape_identifier...
1.19
KB
-rw-r--r--
insert_table_missing_notnull_c...
1.17
KB
-rw-r--r--
insert_table_string_quoting.te...
1.31
KB
-rw-r--r--
installxplugin.test
11.13
KB
-rw-r--r--
killconnection.test
4.78
KB
-rw-r--r--
message_empty_payload.test
1.42
KB
-rw-r--r--
message_protobuf_nested-master...
31
B
-rw-r--r--
message_protobuf_nested.test
2.55
KB
-rw-r--r--
multiple_resultsets_and_out_pa...
4.72
KB
-rw-r--r--
mysql_session_user.test
2.91
KB
-rw-r--r--
mysqlx_server_var.test
6.25
KB
-rw-r--r--
mysqlxtest_help.test
620
B
-rw-r--r--
notice_warning.test
2.61
KB
-rw-r--r--
notice_warning_mysqlx.test
2.14
KB
-rw-r--r--
notices_disable-master.opt
53
B
-rw-r--r--
notices_disable.test
31.05
KB
-rw-r--r--
notices_disable_mysqlx-master....
53
B
-rw-r--r--
notices_disable_mysqlx.test
21.94
KB
-rw-r--r--
notices_enable-master.opt
86
B
-rw-r--r--
notices_enable.test
33.99
KB
-rw-r--r--
notices_enable_mysqlx-master.o...
86
B
-rw-r--r--
notices_enable_mysqlx.test
25.1
KB
-rw-r--r--
performance_schema-master.opt
167
B
-rw-r--r--
performance_schema.test
20.09
KB
-rw-r--r--
performance_schema_memory.test
5.61
KB
-rw-r--r--
performance_schema_sockets-mas...
167
B
-rw-r--r--
performance_schema_sockets.tes...
8.59
KB
-rw-r--r--
performance_schema_threads-mas...
211
B
-rw-r--r--
performance_schema_threads.tes...
2.26
KB
-rw-r--r--
performance_schema_unixsockets...
8.41
KB
-rw-r--r--
plugin_license.test
613
B
-rw-r--r--
regression-master.opt
82
B
-rw-r--r--
regression.test
4.74
KB
-rw-r--r--
result_types.test
896
B
-rw-r--r--
session_reset.test
2.18
KB
-rw-r--r--
status_bytes_received.test
2.04
KB
-rw-r--r--
status_variable_errors_unknown...
31
B
-rw-r--r--
status_variable_errors_unknown...
3.15
KB
-rw-r--r--
status_variable_notices.test
751
B
-rw-r--r--
status_variables-master.opt
42
B
-rw-r--r--
status_variables.test
13.86
KB
-rw-r--r--
status_variables_incrementing....
2.52
KB
-rw-r--r--
stmtexecute_query_no_result.te...
1.07
KB
-rw-r--r--
stmtexecute_query_result.test
1.45
KB
-rw-r--r--
stmtexecute_status_vars.test
18.41
KB
-rw-r--r--
stmtexecute_with_args.test
5.27
KB
-rw-r--r--
suite.opt
30
B
-rw-r--r--
system_variable_bind_address.t...
2.27
KB
-rw-r--r--
system_variable_max_allowed_pa...
31
B
-rw-r--r--
system_variable_max_allowed_pa...
1.6
KB
-rw-r--r--
system_variable_min_worker_thr...
709
B
-rw-r--r--
system_variable_port_open_time...
6.79
KB
-rw-r--r--
system_variables.test
4.18
KB
-rw-r--r--
update_crud_arrayappend_o.test
17.02
KB
-rw-r--r--
update_crud_arrayinsert_o.test
21.96
KB
-rw-r--r--
update_crud_itemmerge_o.test
16.5
KB
-rw-r--r--
update_crud_o.test
31.18
KB
-rw-r--r--
update_crud_remove_o.test
14.41
KB
-rw-r--r--
update_crud_replace_o.test
18.42
KB
-rw-r--r--
update_doc.test
22.58
KB
-rw-r--r--
update_sql_o.test
5.23
KB
-rw-r--r--
update_table.test
9.51
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : update_crud_o.test
########### ../t/update_crud_o.test ############# ### # ### This test runs aims to run UPDATE SET operation statement variant # ### with mysqlxtest client. # ### Test covers # ### - update with safe_update mode(ON/OFF) # ### - update with different operators # ### - update on multiple rows # ### - update with data model as table # ### - update with data model as document # ### - update multiple column # ### - update using transaction # ### - update with multiple condition # ### - Update immutable document member _id (Error expected ) # ### - Update _id virtual column(possible using data_model:TABLE) # ### - status variable Mysqlx_crud_update for number of Update # ### requests received # ### # ######################################################################## # --echo ============================================== --echo CRUD UPDATE SCENARIOS --echo ============================================== --echo ## Preamble --echo ================================================================================ --echo PREAMBLE --echo ================================================================================ --source ../include/xplugin_preamble.inc create user updatecruduser@localhost identified by 'updatecruduser'; grant all on *.* to updatecruduser@localhost; ## TEST STARTS HERE --echo ================================================================================ --echo TEST START --echo ================================================================================ --write_file $MYSQL_TMP_DIR/mysqlx-update_crud_safemode_1.tmp -->sql DROP SCHEMA if EXISTS mysqlxplugin; CREATE SCHEMA mysqlxplugin DEFAULT CHARSET='utf8'; USE mysqlxplugin; CREATE TABLE categories ( CategoryID int NOT NULL AUTO_INCREMENT, CategoryName varchar(100), CategoryDescription varchar(200), CategoryIMEI tinyint, CategoryDecimal decimal(5,2), CategoryBool bit(1), PRIMARY key (CategoryID) ); INSERT INTO categories(CategoryID, CategoryName, CategoryDescription, CategoryIMEI, CategoryDecimal,CategoryBool) VALUES (1,'Sports','Sports related category',1,235.15,true), (2,'Entertaiment','Entertaiment related category',2,235.15,false), (3, 'Home','Home related category',3,235.15,true), (4, 'Kitchen','Kitchen related category',4,235.15,false), (5, 'Garden','Garden related category',5,535.15,true), (6, 'Toys','Toys related category',6,635.15,false); ## SQL safe updates as 1 will allow to update only when you use a key column in the wehere clause SET SQL_SAFE_UPDATES = 1; SHOW STATUS like 'Mysqlx_crud_update'; -->endsql -->echo Update varchar with where based in key column Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 1 } } } } operation { source { name: "CategoryName" } operation: SET value { type: LITERAL literal { type: V_STRING v_string { value: "SportsUpdate" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID=1; SHOW STATUS like 'Mysqlx_crud_update'; -->endsql -->echo Update Tiny Int with where based in key column Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 1 } } } } operation { source { name: "CategoryIMEI" } operation: SET value { type: LITERAL literal { type: V_SINT v_signed_int: 110 } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID=1; SHOW STATUS like 'Mysqlx_crud_update'; -->endsql -->echo Update Decimal with where based in key column Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 1 } } } } operation { source { name: "CategoryDecimal" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: 613.57 } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID in (1,2); SHOW STATUS like 'Mysqlx_crud_update'; -->endsql ## Corner Values -->echo Update with Quotes value Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 2 } } } } operation { source { name: "CategoryDescription" } operation: SET value { type: LITERAL literal { type: V_STRING v_string{ value: "\"Quotes\"" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID=2; SHOW STATUS like 'Mysqlx_crud_update'; -->endsql -->echo Update with NULL value Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 2 } } } } operation { source { name: "CategoryName" } operation: SET value { type: LITERAL literal { type: V_NULL } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID in (2,3); SHOW STATUS like 'Mysqlx_crud_update'; -->endsql -->echo Update with Corner decimal value and != operator Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "!=" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 2 } } } } operation { source { name: "CategoryDecimal" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: 999.99 } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID != 2; SHOW STATUS like 'Mysqlx_crud_update'; -->endsql -->echo Update with Corner decimal value and "in" operator Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "in" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 3 } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } } } operation { source { name: "CategoryDecimal" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: -999.99 } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID in (3,4); SHOW STATUS like 'Mysqlx_crud_update'; -->endsql -->echo Update with Corner decimal value and != operator Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "!=" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 2 } } } } operation { source { name: "CategoryIMEI" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: 127 } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID != 2; SHOW STATUS like 'Mysqlx_crud_update'; -->endsql -->echo Update with Corner decimal value and "in" operator Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "in" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } param { type: LITERAL literal { type: V_SINT v_signed_int: 5 } } } } operation { source { name: "CategoryIMEI" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: -128 } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID in (4,5); SHOW STATUS like 'Mysqlx_crud_update'; -->endsql EOF --exec $MYSQLXTEST -u updatecruduser --password='updatecruduser' --file=$MYSQL_TMP_DIR/mysqlx-update_crud_safemode_1.tmp 2>&1 --remove_file $MYSQL_TMP_DIR/mysqlx-update_crud_safemode_1.tmp --echo . --echo #---------- TEST WITH SAFE MODE OFF ----------# --echo . ## *************************************** ## Start test with safe mode off | ## | ## *************************************** --write_file $MYSQL_TMP_DIR/mysqlx-update_crud_safemode_0.tmp -->sql USE mysqlxplugin; ## SQL safe updates as 0 will allow to update without the need to use a key column SET SQL_SAFE_UPDATES = 0; -->endsql -->echo Update with wrong schema name Mysqlx.Crud.Update { collection { name: "categories" schema: "noschemalikethis" } data_model: TABLE criteria { type: OPERATOR operator { name: "in" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } param { type: LITERAL literal { type: V_SINT v_signed_int: 5 } } } } operation { source { name: "CategoryIMEI" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: 101 } } } } -- Mysqlx.Error -->recv -->echo Update with wrong table name Mysqlx.Crud.Update { collection { name: "notablelikethis" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "in" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } param { type: LITERAL literal { type: V_SINT v_signed_int: 5 } } } } operation { source { name: "CategoryIMEI" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: 101.02 } } } } -- Mysqlx.Error -->recv -->echo Update with wrong column name Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "in" param { type: IDENT identifier { name: "nocolumnname" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } param { type: LITERAL literal { type: V_SINT v_signed_int: 5 } } } } operation { source { name: "CategoryIMEI" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: 101 } } } } -- Mysqlx.Error -->recv -->echo Update decimal value with a corner value plus 1 Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } } } operation { source { name: "CategoryDecimal" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: 1000.00 } } } } -- Mysqlx.Error -->expecterror 1264 -->recvresult -->echo Update tiny int value with a corner value plus 1 Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } } } operation { source { name: "CategoryIMEI" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: -129 } } } } -- Mysqlx.Error -->expecterror 1264 -->recvresult -->echo Update multiple column -->sql select * from mysqlxplugin.categories where CategoryID=4; -->endsql Mysqlx.Crud.Update { collection { name: "categories" schema: "mysqlxplugin" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "CategoryID" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } } } operation { source { name: "CategoryIMEI" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: -99 } } } operation { source { name: "CategoryDecimal" } operation: SET value { type: LITERAL literal { type: V_DOUBLE v_double: 501.11 } } } } -->recvresult -->sql select * from mysqlxplugin.categories where CategoryID=4; -->endsql EOF --exec $MYSQLXTEST -u updatecruduser --password='updatecruduser' --file=$MYSQL_TMP_DIR/mysqlx-update_crud_safemode_0.tmp 2>&1 --remove_file $MYSQL_TMP_DIR/mysqlx-update_crud_safemode_0.tmp ## *************************************** ## Test with safe mode off for Collection | ## | ## *************************************** --write_file $MYSQL_TMP_DIR/mysqlx-update_crud_collection_safemode_0.tmp -->sql SET SQL_SAFE_UPDATES = 0; DROP SCHEMA if EXISTS mysqlxcoll; CREATE SCHEMA mysqlxcoll; USE mysqlxcoll; CREATE TABLE maincoll (doc JSON, _id VARCHAR(32) NOT NULL PRIMARY KEY); INSERT INTO maincoll (doc, _id) values ('{"_id": "1", "name": "Victor", "last_name": "Otero","amount": 4.99}',json_unquote(json_extract(doc, '$._id'))); INSERT INTO maincoll (doc, _id) values ('{"_id": "2", "name": "Gonzalo", "last_name": "Chrystens","amount": 120.57}',json_unquote(json_extract(doc, '$._id'))); INSERT INTO maincoll (doc, _id) values ('{"_id": "3", "name": "Abraham", "last_name": "Vega","amount": 74.56}',json_unquote(json_extract(doc, '$._id'))); INSERT INTO maincoll (doc, _id) values ('{"_id": "4", "name": "Jennifer", "last_name": "Leon","amount": 387.14}',json_unquote(json_extract(doc, '$._id'))); INSERT INTO maincoll (doc, _id) values ('{"_id": "5", "name": "Jhonny", "last_name": "Test","amount": 125.45}',json_unquote(json_extract(doc, '$._id'))); -->endsql -->echo Update a valid collection with string value and > operator for multiple docs Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: ">" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"3"} } } } } operation { source { document_path { type: MEMBER value: "name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "\"xtest_>\"" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from maincoll; -->endsql -->echo Update a valid collection with string value and > operator for multiple docs Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: "<" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"3"} } } } } operation { source { document_path { type: MEMBER value: "name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "\"xtest_<\"" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from maincoll; -->endsql -->echo Update a valid collection with string value and <= operator for multiple docs Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: "<=" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"3"} } } } } operation { source { document_path { type: MEMBER value: "name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "\"xtest_<=\"" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from maincoll; -->endsql -->echo Update a valid collection with string value and >= operator for multiple docs Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: ">=" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"4"} } } } } operation { source { document_path { type: MEMBER value: "name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "\"xtest_>=\"" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from maincoll; -->endsql -->echo Update a valid collection with string value and != operator for multiple docs Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: "!=" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"2"} } } } } operation { source { document_path { type: MEMBER value: "last_name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "\"xtest_!=\"" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from maincoll; -->endsql -->echo Update order clause update last _id in desc order (_id = 5) Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: "!=" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"0"} } } } } limit { row_count: 1 } order { expr { type: IDENT identifier { name: "_id" } } direction: DESC } operation { source { document_path { type: MEMBER value: "last_name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "\"Limit1OrderDesc\"" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from maincoll; -->endsql -->echo Update with order clause update first two _id in asc order (_id = 1,2) Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: "!=" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"0"} } } } } limit { row_count: 2 } order { expr { type: IDENT identifier { name: "_id" } } direction: ASC } operation { source { document_path { type: MEMBER value: "last_name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "\"Limit2OrderAsc\"" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->recvresult -->sql select * from maincoll; -->endsql -->echo Invalid type of update for Document Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: ">" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"3"} } } } } operation { source { document_path { type: MEMBER value: "name" } } operation: SET value { type: LITERAL literal { type: V_STRING v_string { value: "xtest" } } } } } -- Mysqlx.Sql.StmtExecuteOk -->expecterror 5051 -->recvresult -->echo Update multiple column + transaction -->sql START TRANSACTION; -->endsql Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: ">" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"3"} } } } } operation { source { document_path { type: MEMBER value: "name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "name_mul_update_save_a" } } } } operation { source { document_path { type: MEMBER value: "last_name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "last_name_mul_update_save_a" } } } } } -->recvresult -->sql SELECT * FROM mysqlxcoll.maincoll where _id > 3; SAVEPOINT A; -->endsql Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: ">" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_OCTETS v_octets {value:"3"} } } } } operation { source { document_path { type: MEMBER value: "name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "name_mul_update_save_b" } } } } operation { source { document_path { type: MEMBER value: "last_name" } } operation: ITEM_SET value { type: LITERAL literal { type: V_STRING v_string { value: "last_name_mul_update_save_b" } } } } } -->recvresult -->sql SELECT * FROM mysqlxcoll.maincoll where _id > 3; ROLLBACK TO SAVEPOINT A; COMMIT; SELECT * FROM mysqlxcoll.maincoll where _id > 3; -->endsql -->echo document member _id is immutable Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { document_path { type: MEMBER value: "last_name" } } } param { type: LITERAL literal { type: V_STRING v_string { value: "Chrystens" } } } } } operation { source { document_path { type: MEMBER value: "_id" } } operation: ITEM_SET value { type: LITERAL literal { type: V_OCTETS v_octets {value:"11"} } } } } # Error -->expecterror 5053 -->recvresult -->sql SELECT * FROM mysqlxcoll.maincoll; -->endsql -->echo document member _id is immutable but _id column can be updated Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: TABLE criteria { type: OPERATOR operator { name: "==" param { type: IDENT identifier { document_path { type: MEMBER value: "last_name" } } } param { type: LITERAL literal { type: V_STRING v_string { value: "Chrystens" } } } } } operation { source { name: "_id" } operation: SET value { type: LITERAL literal { type: V_OCTETS v_octets {value:"11"} } } } } -->recvresult -->sql SELECT * FROM mysqlxcoll.maincoll; -->endsql # -->echo Update using multiple condition Mysqlx.Crud.Update { collection { name: "maincoll" schema: "mysqlxcoll" } data_model: DOCUMENT criteria { type: OPERATOR operator { name: "&&" param { type: OPERATOR operator { name: ">=" param { type: IDENT identifier { document_path { type: MEMBER value: "_id" } } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } } } param { type: OPERATOR operator { name: "==" param { type: IDENT identifier { name: "_id" } } param { type: LITERAL literal { type: V_SINT v_signed_int: 4 } } } } } } operation { source { document_path { type: MEMBER value: "amount" } } operation: ITEM_SET value { type: LITERAL literal { type: V_OCTETS v_octets {value:"444"} } } } } -->recvresult -->sql SELECT * FROM mysqlxcoll.maincoll; -->endsql ## Cleanup -->echo ================================================================================ -->echo CLEAN UP -->echo ================================================================================ -->sql DROP SCHEMA if EXISTS mysqlxplugin; DROP SCHEMA if EXISTS mysqlxcoll; DROP USER updatecruduser@localhost; SET SQL_SAFE_UPDATES = 1; -->endsql EOF --exec $MYSQLXTEST -u updatecruduser --password='updatecruduser' --file=$MYSQL_TMP_DIR/mysqlx-update_crud_collection_safemode_0.tmp 2>&1 --remove_file $MYSQL_TMP_DIR/mysqlx-update_crud_collection_safemode_0.tmp ## Postamble --echo ================================================================================ --echo POSTAMBLE --echo ================================================================================ uninstall plugin mysqlx;
Close