⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
suite
/
x
/
r
/
View File Name :
crud_doc_expr_object.result
install plugin mysqlx soname "mysqlx.so"; call mtr.add_suppression("Plugin mysqlx reported: .Failed at SSL configuration: .SSL context is not usable without certificate and private key.."); call mtr.add_suppression("Plugin mysqlx reported: .SSL_CTX_load_verify_locations failed."); RUN DROP SCHEMA IF EXISTS xtest 0 rows affected RUN CREATE SCHEMA xtest 1 rows affected RUN CREATE TABLE xtest.xcoll (doc JSON, _id VARBINARY(16) GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(doc, '$._id'))) STORED PRIMARY KEY) 0 rows affected Inserting object into collection send Mysqlx.Crud.Insert { collection { name: "xcoll" schema: "xtest" } data_model: DOCUMENT row { field { type: OBJECT object { fld { key: "_id" value { type: LITERAL literal { type: V_OCTETS v_octets { value: "1" } } } } fld { key: "first_name" value { type: LITERAL literal { type: V_OCTETS v_octets { value: "John" } } } } fld { key: "last_name" value { type: LITERAL literal { type: V_OCTETS v_octets { value: "Snow" } } } } } } } } 1 rows affected RUN SELECT * FROM xtest.xcoll doc _id {"_id": "1", "last_name": "Snow", "first_name": "John"} 1 0 rows affected Selecting object from collection send Mysqlx.Crud.Find { collection { name: "xcoll" schema: "xtest" } data_model: DOCUMENT projection { source { type: OBJECT object { fld { key: "name" value { type: FUNC_CALL function_call { name { name: "concat" } param { type: IDENT identifier { document_path { type: MEMBER value: "first_name" } } } param { type: LITERAL literal { type: V_OCTETS v_octets { value: " " } } } param { type: IDENT identifier { document_path { type: MEMBER value: "last_name" } } } } } } fld { key: "number" value { type: OPERATOR operator { name: "+" param { type: LITERAL literal { type: V_SINT v_signed_int: 1 } } param { type: LITERAL literal { type: V_SINT v_signed_int: 1 } } } } } } } } } doc {"name": "John Snow", "number": 2} command ok Selecting object from collection with alias send Mysqlx.Crud.Find { collection { name: "xcoll" schema: "xtest" } data_model: DOCUMENT projection { source { type: OBJECT object { fld { key: "name" value { type: FUNC_CALL function_call { name { name: "concat" } param { type: IDENT identifier { document_path { type: MEMBER value: "first_name" } } } param { type: LITERAL literal { type: V_OCTETS v_octets { value: " " } } } param { type: IDENT identifier { document_path { type: MEMBER value: "last_name" } } } } } } } } alias: "hero" } } doc {"hero": {"name": "John Snow"}} command ok Selecting object with sub-object from collection send Mysqlx.Crud.Find { collection { name: "xcoll" schema: "xtest" } data_model: DOCUMENT projection { source { type: OBJECT object { fld { key: "name" value { type: FUNC_CALL function_call { name { name: "concat" } param { type: IDENT identifier { document_path { type: MEMBER value: "first_name" } } } param { type: LITERAL literal { type: V_OCTETS v_octets { value: " " } } } param { type: IDENT identifier { document_path { type: MEMBER value: "last_name" } } } } } } fld { key: "detail" value { type: OBJECT object { fld { key: "first" value { type: IDENT identifier { document_path { type: MEMBER value: "first_name" } } } } fld { key: "last" value { type: IDENT identifier { document_path { type: MEMBER value: "last_name" } } } } } } } } } } } doc {"name": "John Snow", "detail": {"last": "Snow", "first": "John"}} command ok Updating collection by object send Mysqlx.Crud.Update { collection { name: "xcoll" schema: "xtest" } data_model: DOCUMENT operation { source { document_path { type: MEMBER value: "occupation" } } operation: ITEM_SET value { type: OBJECT object { fld { key: "location" value { type: LITERAL literal { type: V_OCTETS v_octets { value: "the wall" } } } } fld { key: "title" value { type: LITERAL literal { type: V_OCTETS v_octets { value: "lord commander" } } } } } } } } 1 rows affected Rows matched: 1 Changed: 1 Warnings: 0 RUN SELECT * FROM xtest.xcoll doc _id {"_id": "1", "last_name": "Snow", "first_name": "John", "occupation": {"title": "lord commander", "location": "the wall"}} 1 0 rows affected NOT Error: empty object send Mysqlx.Crud.Find { collection { name: "xcoll" schema: "xtest" } data_model: DOCUMENT projection { source { type: OBJECT object { } } } } doc {} command ok Error: empty object key send Mysqlx.Crud.Find { collection { name: "xcoll" schema: "xtest" } data_model: DOCUMENT projection { source { type: OBJECT object { fld { key: "" value { type: IDENT identifier { document_path { type: MEMBER value: "first_name" } } } } } } } } Got expected error: Mysqlx.Error { severity: ERROR code: 5154 msg: "Invalid key for Mysqlx::Expr::Object" sql_state: "HY000" } RUN drop schema if exists xtest 1 rows affected Mysqlx.Ok { msg: "bye!" } ok uninstall plugin mysqlx;