~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/json_server/tests/r/basic.result

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-10-29 15:43:40 UTC
  • mfrom: (1.2.12) (2.1.19 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20131029154340-2gp39el6cv8bwf2o
Tags: 1:7.2.3-2ubuntu1
* Merge from debian, remaining changes:
  - Link against boost_system because of boost_thread.
  - Add required libs to message/include.am
  - Add upstart job and adjust init script to be upstart compatible.
  - Disable -floop-parallelize-all due to gcc-4.8/4.9 compiler ICE
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57732

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
create table t1 (a int primary key auto_increment, b varchar(100));
2
 
select http_post("http://localhost:PORT/0.1/sql", 'select * from t1;');;
3
 
http_post("http://localhost:PORT/0.1/sql", 'select * from t1;')
 
2
select http_post("http://localhost:PORT/sql", 'select * from t1;');;
 
3
http_post("http://localhost:PORT/sql", 'select * from t1;')
4
4
{
5
5
   "query" : "select * from t1;",
6
6
   "sqlstate" : "00000"
7
7
}
8
8
 
9
9
insert into t1 (b) values ("from MySQL protocol");
10
 
select http_post('http://localhost:PORT/0.1/sql', 'select * from t1;');;
11
 
http_post('http://localhost:PORT/0.1/sql', 'select * from t1;')
 
10
select http_post('http://localhost:PORT/sql', 'select * from t1;');;
 
11
http_post('http://localhost:PORT/sql', 'select * from t1;')
12
12
{
13
13
   "query" : "select * from t1;",
14
14
   "result_set" : [
17
17
   "sqlstate" : "00000"
18
18
}
19
19
 
20
 
select http_post('http://localhost:PORT/0.1/sql', 'insert into t1 (b) values (\'from http\');');;
21
 
http_post('http://localhost:PORT/0.1/sql', 'insert into t1 (b) values (\'from http\');')
 
20
select http_post('http://localhost:PORT/sql', 'insert into t1 (b) values (\'from http\');');;
 
21
http_post('http://localhost:PORT/sql', 'insert into t1 (b) values (\'from http\');')
22
22
{
23
23
   "query" : "insert into t1 (b) values ('from http');",
24
24
   "sqlstate" : "00000"
29
29
1       from MySQL protocol
30
30
2       from http
31
31
drop table t1;
 
32
create schema json;
 
33
use json;
 
34
{
 
35
   "sqlstate" : "00000"
 
36
}
 
37
{
 
38
   "result_set" : [
 
39
      {
 
40
         "_id" : 1,
 
41
         "document" : {
 
42
            "age" : 35,
 
43
            "firstname" : "Henrik",
 
44
            "lastname" : "Ingo"
 
45
         }
 
46
      }
 
47
   ],
 
48
   "sqlstate" : "00000"
 
49
}
 
50
{
 
51
   "result_set" : [
 
52
      {
 
53
         "_id" : 1,
 
54
         "document" : {
 
55
            "age" : 35,
 
56
            "firstname" : "Henrik",
 
57
            "lastname" : "Ingo"
 
58
         }
 
59
      }
 
60
   ],
 
61
   "sqlstate" : "00000"
 
62
}
 
63
{
 
64
   "sqlstate" : "00000"
 
65
}
 
66
{
 
67
   "result_set" : [
 
68
      {
 
69
         "_id" : 1,
 
70
         "document" : {
 
71
            "age" : 36,
 
72
            "firstname" : "Henrik",
 
73
            "lastname" : "Ingo"
 
74
         }
 
75
      }
 
76
   ],
 
77
   "sqlstate" : "00000"
 
78
}
 
79
{
 
80
   "error_message" : "* Line 1, Column 1\n  Syntax error: value, object or array expected.\n",
 
81
   "error_type" : "json error"
 
82
}
 
83
{
 
84
   "error_message" : "table must be specified in URI query string.",
 
85
   "error_type" : "http error"
 
86
}
 
87
{
 
88
   "error_message" : "table must be specified in URI query string.",
 
89
   "error_type" : "http error"
 
90
}
 
91
{
 
92
   "sqlstate" : "00000"
 
93
}
 
94
{
 
95
   "result_set" : [
 
96
      {
 
97
         "_id" : 1,
 
98
         "document" : {
 
99
            "age" : 36,
 
100
            "firstname" : "Henrik",
 
101
            "lastname" : "Ingo"
 
102
         }
 
103
      },
 
104
      {
 
105
         "_id" : 2,
 
106
         "document" : {
 
107
            "age" : 21,
 
108
            "firstname" : "Mohit",
 
109
            "lastname" : "Srivastava"
 
110
         }
 
111
      }
 
112
   ],
 
113
   "sqlstate" : "00000"
 
114
}
 
115
{
 
116
   "result_set" : [
 
117
      {
 
118
         "_id" : 1,
 
119
         "document" : {
 
120
            "age" : 36,
 
121
            "firstname" : "Henrik",
 
122
            "lastname" : "Ingo"
 
123
         }
 
124
      },
 
125
      {
 
126
         "_id" : 2,
 
127
         "document" : {
 
128
            "age" : 21,
 
129
            "firstname" : "Mohit",
 
130
            "lastname" : "Srivastava"
 
131
         }
 
132
      }
 
133
   ],
 
134
   "sqlstate" : "00000"
 
135
}
 
136
{
 
137
   "result_set" : [
 
138
      {
 
139
         "_id" : 1,
 
140
         "document" : {
 
141
            "age" : 36,
 
142
            "firstname" : "Henrik",
 
143
            "lastname" : "Ingo"
 
144
         }
 
145
      },
 
146
      {
 
147
         "_id" : 2,
 
148
         "document" : {
 
149
            "age" : 21,
 
150
            "firstname" : "Mohit",
 
151
            "lastname" : "Srivastava"
 
152
         }
 
153
      }
 
154
   ],
 
155
   "sqlstate" : "00000"
 
156
}
 
157
SET GLOBAL json_server_schema="json";
 
158
{
 
159
   "result_set" : [
 
160
      {
 
161
         "_id" : 1,
 
162
         "document" : {
 
163
            "age" : 36,
 
164
            "firstname" : "Henrik",
 
165
            "lastname" : "Ingo"
 
166
         }
 
167
      },
 
168
      {
 
169
         "_id" : 2,
 
170
         "document" : {
 
171
            "age" : 21,
 
172
            "firstname" : "Mohit",
 
173
            "lastname" : "Srivastava"
 
174
         }
 
175
      }
 
176
   ],
 
177
   "sqlstate" : "00000"
 
178
}
 
179
SET GLOBAL json_server_table="people";
 
180
{
 
181
   "result_set" : [
 
182
      {
 
183
         "_id" : 1,
 
184
         "document" : {
 
185
            "age" : 36,
 
186
            "firstname" : "Henrik",
 
187
            "lastname" : "Ingo"
 
188
         }
 
189
      },
 
190
      {
 
191
         "_id" : 2,
 
192
         "document" : {
 
193
            "age" : 21,
 
194
            "firstname" : "Mohit",
 
195
            "lastname" : "Srivastava"
 
196
         }
 
197
      }
 
198
   ],
 
199
   "sqlstate" : "00000"
 
200
}
 
201
{
 
202
   "error_message" : "* Line 1, Column 19\n  Missing ',' or '}' in object declaration\n",
 
203
   "error_type" : "json error"
 
204
}
 
205
{
 
206
   "sqlstate" : "00000"
 
207
}
 
208
{
 
209
   "sqlstate" : "00000"
 
210
}
 
211
{
 
212
   "sqlstate" : "00000"
 
213
}
 
214
{
 
215
   "result_set" : [
 
216
      {
 
217
         "_id" : 1,
 
218
         "document" : {
 
219
            "age" : 35,
 
220
            "firstname" : "Henrik",
 
221
            "lastname" : "Ingo"
 
222
         },
 
223
         "metadata" : {
 
224
            "dob" : "16-feb-1977",
 
225
            "interest" : "opensource",
 
226
            "nick" : "hingo"
 
227
         }
 
228
      }
 
229
   ],
 
230
   "sqlstate" : "00000"
 
231
}
 
232
{
 
233
   "sqlstate" : "00000"
 
234
}
 
235
{
 
236
   "result_set" : [
 
237
      {
 
238
         "_id" : 2,
 
239
         "document" : {
 
240
            "age" : 21,
 
241
            "firstname" : "Mohit",
 
242
            "lastname" : "Srivastava"
 
243
         }
 
244
      }
 
245
   ],
 
246
   "sqlstate" : "00000"
 
247
}
 
248
{
 
249
   "sqlstate" : "00000"
 
250
}
 
251
{
 
252
   "sqlstate" : "00000"
 
253
}
 
254
{
 
255
   "error_message" : "_id must be specified in URI query string or set --json_server.allow_drop_table =true",
 
256
   "error_type" : "http error"
 
257
}
 
258
{
 
259
   "error_message" : "_id must be specified in URI query string or set --json_server.allow_drop_table =true",
 
260
   "error_type" : "http error"
 
261
}
 
262
{
 
263
   "error_message" : "_id must be specified in URI query string or set --json_server.allow_drop_table =true",
 
264
   "error_type" : "http error"
 
265
}
 
266
{
 
267
   "error_message" : "_id must be specified in URI query string or set --json_server.allow_drop_table =true",
 
268
   "error_type" : "http error"
 
269
}
 
270
SET GLOBAL json_server_allow_drop_table="ON";
 
271
{
 
272
   "sqlstate" : "00000"
 
273
}
 
274
{
 
275
   "error_code" : 1146,
 
276
   "error_message" : "Unknown table 'json.people'",
 
277
   "error_type" : "sql error",
 
278
   "internal_sql_query" : "SELECT * FROM `json`.`people`;",
 
279
   "schema" : "json",
 
280
   "sqlstate" : "00000",
 
281
   "table" : "people"
 
282
}
 
283
{
 
284
   "sqlstate" : "00000"
 
285
}
 
286
SET GLOBAL json_server_allow_drop_table="OFF";
 
287
SET GLOBAL json_server_table="";
 
288
SET GLOBAL json_server_schema="test";
 
289
drop schema json;