Debian Codegraph @

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

raw
1 ## generated
2 ## Rel: Find matches in a table
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_table_find.xpl
11 ## Test data
12 -->sql
13 use xtest;
14 CREATE TABLE `city` (
15 `ID` int(11) NOT NULL auto_increment,
16 `Name` char(35) NOT NULL default '',
17 `CountryCode` char(3) NOT NULL default '',
18 `District` char(20) NOT NULL default '',
19 `Population` int(11) NOT NULL default '0',
20 PRIMARY KEY (`ID`)
21 );
22 INSERT INTO `city` VALUES (1,'Kabul','AFG','Kabol',1780000);
23 INSERT INTO `city` VALUES (2,'Qandahar','AFG','Qandahar',237500);
24 INSERT INTO `city` VALUES (3,'Herat','AFG','Herat',186800);
25 INSERT INTO `city` VALUES (4,'Mazar-e-Sharif','AFG','Balkh',127800);
26 INSERT INTO `city` VALUES (5,'Amsterdam','NLD','Noord-Holland',731200);
27 INSERT INTO `city` VALUES (6,'Rotterdam','NLD','Zuid-Holland',593321);
28 INSERT INTO `city` VALUES (7,'Haag','NLD','Zuid-Holland',440900);
29 INSERT INTO `city` VALUES (8,'Utrecht','NLD','Utrecht',234323);
30 INSERT INTO `city` VALUES (9,'Eindhoven','NLD','Noord-Brabant',201843);
31 INSERT INTO `city` VALUES (10,'Tilburg','NLD','Noord-Brabant',193238);
32 INSERT INTO `city` VALUES (11,'Groningen','NLD','Groningen',172701);
33 INSERT INTO `city` VALUES (12,'Breda','NLD','Noord-Brabant',160398);
34 INSERT INTO `city` VALUES (13,'Apeldoorn','NLD','Gelderland',153491);
35 INSERT INTO `city` VALUES (14,'Nijmegen','NLD','Gelderland',152463);
36 INSERT INTO `city` VALUES (15,'Enschede','NLD','Overijssel',149544);
37 INSERT INTO `city` VALUES (16,'Haarlem','NLD','Noord-Holland',148772);
38 -->endsql
39 Mysqlx.Crud.Find {
40 collection {
41 name: "city"
42 schema: "xtest"
43 }
44 data_model: TABLE
45 criteria {
46 type: OPERATOR
47 operator {
48 name: "<"
49 param {
50 type: IDENT
51 identifier {
52 name: "Population"
53 }
54 }
55 param {
56 type: LITERAL
57 literal {
58 type: V_SINT
59 v_signed_int: 150000
60 }
61 }
62 }
63 }
64 }
65
66 ## expect Mysqlx.Resultset.ColumnMetaData
67 -->recv
68 ## expect Mysqlx.Resultset.ColumnMetaData
69 -->recv
70 ## expect Mysqlx.Resultset.ColumnMetaData
71 -->recv
72 ## expect Mysqlx.Resultset.ColumnMetaData
73 -->recv
74 ## expect Mysqlx.Resultset.ColumnMetaData
75 -->recv
76 ## expect Mysqlx.Resultset.Row
77 -->recv
78 ## expect Mysqlx.Resultset.Row
79 -->recv
80 ## expect Mysqlx.Resultset.Row
81 -->recv
82 ## expect Mysqlx.Resultset.FetchDone
83 -->recv
84 ## expect Mysqlx.Sql.StmtExecuteOk
85 -->recv
86 EOF
87
88 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/find_table_find.xpl 2>&1
89
90 ## Cleanup
91 --source ../include/xplugin_cleanup.inc