Current Path : /usr/opt/mysql57/mysql-test/suite/x/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/mysql57/mysql-test/suite/x/t/crud_order_by.test |
## Put records in order using members of json doc ## Preamble --source ../include/xplugin_preamble.inc ## Test starts here --write_file $MYSQL_TMP_DIR/crud_order_by.tmp ## Test data -->sql drop schema if exists xtest; create schema xtest; use xtest; create table xcoll (doc JSON); insert into xcoll (doc) values ('{"numeric": 2, "string": "2"}'); insert into xcoll (doc) values ('{"numeric": 70, "string": "70"}'); insert into xcoll (doc) values ('{"numeric": 5, "string": "5"}'); insert into xcoll (doc) values ('{"numeric": 10, "string": "10"}'); insert into xcoll (doc) values ('{"numeric": 1, "string": "1"}'); insert into xcoll (doc) values ('{"numeric": 30, "string": "30"}'); SELECT * FROM xtest.xcoll; -->endsql Mysqlx.Crud.Find { collection { name: "xcoll" schema: "xtest" } data_model: TABLE order { expr { type: IDENT identifier { document_path { type: MEMBER value: "numeric" } } } } } -->recvresult Mysqlx.Crud.Find { collection { name: "xcoll" schema: "xtest" } data_model: TABLE order { expr { type: IDENT identifier { document_path { type: MEMBER value: "string" } } } } } -->recvresult ## Cleanup -->sql drop schema if exists xtest; -->endsql EOF --exec $MYSQLXTEST -uroot --password='' --file=$MYSQL_TMP_DIR/crud_order_by.tmp 2>&1 --remove_file $MYSQL_TMP_DIR/crud_order_by.tmp ## Postamble uninstall plugin mysqlx;