Debian Codegraph @

mysql-test/suite/x/t/find_docpath_expr.test

raw
1 ## generated
2 ## Doc: Find using complex docpaths in expression
3
4 --source include/xplugin_preamble.inc
5 --source include/xplugin_create_user.inc
6
7 create schema xtest default charset 'utf8mb4';
8
9 ## Test starts here
10 --write_file $MYSQL_TMP_DIR/find_docpath_expr.xpl
11 ## Test data
12
13 -->stmtadmin create_collection {"schema":"xtest","name":"fancycoll"}
14 -->recvresult
15
16 -->sql
17 use xtest;
18 insert into fancycoll (doc) values ('\n{\n \"_id\": \"X999_Y999\",\n \"from\": {\n \"name\": \"Tom Brady\", \"id\": \"X12\"\n },\n \"message\": \"Looking forward to 2010!\",\n \"actions\": [\n {\n \"name\": \"Comment\",\n \"link\": \"http://www.facebook.com/X999/posts/Y999\"\n },\n {\n \"name\": \"Like\",\n \"link\": \"http://www.facebook.com/X999/posts/Y999\"\n }\n ],\n \"type\": \"status\",\n \"created_time\": \"2010-08-02T21:27:44+0000\",\n \"updated_time\": \"2010-08-02T21:27:44+0000\"\n }\n');
19 insert into fancycoll (doc) values ('\n{\n \"_id\": \"X999_Y998\",\n \"from\": {\n \"name\": \"Dom Crady\", \"id\": \"A12\"\n },\n \"message\": \"Looking forward to 2034!\",\n \"actions\": [\n {\n \"name\": \"Comment\",\n \"link\": \"http://www.facebook.com/X999/posts/Y222\"\n },\n {\n \"name\": \"Like\",\n \"link\": \"http://www.facebook.com/X999/posts/Y222\"\n }\n ],\n \"type\": \"status\",\n \"created_time\": \"2011-08-02T21:27:44+0000\",\n \"updated_time\": \"2011-08-02T21:27:44+0000\"\n }\n');
20 -->endsql
21
22 Mysqlx.Crud.Find {
23 collection {
24 name: "fancycoll"
25 schema: "xtest"
26 }
27 data_model: DOCUMENT
28 criteria {
29 type: OPERATOR
30 operator {
31 name: "!="
32 param {
33 type: IDENT
34 identifier {
35 document_path {
36 type: MEMBER
37 value: "from"
38 }
39 document_path {
40 type: MEMBER
41 value: "id"
42 }
43 }
44 }
45 param {
46 type: LITERAL
47 literal {
48 type: V_OCTETS
49 v_octets {value:"X12"}
50 }
51 }
52 }
53 }
54 }
55
56 ## expect Mysqlx.Resultset.ColumnMetaData
57 -->recv
58 ## expect Mysqlx.Resultset.Row
59 -->recv
60 ## expect Mysqlx.Resultset.FetchDone
61 -->recv
62 ## expect Mysqlx.Sql.StmtExecuteOk
63 -->recv
64 EOF
65
66 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/find_docpath_expr.xpl 2>&1
67
68 ## Cleanup
69 --source ../include/xplugin_cleanup.inc