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;')
5
5
"query" : "select * from t1;",
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;')
13
13
"query" : "select * from t1;",
17
17
"sqlstate" : "00000"
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\');')
23
23
"query" : "insert into t1 (b) values ('from http');",
24
24
"sqlstate" : "00000"
29
29
1 from MySQL protocol
43
"firstname" : "Henrik",
56
"firstname" : "Henrik",
72
"firstname" : "Henrik",
80
"error_message" : "* Line 1, Column 1\n Syntax error: value, object or array expected.\n",
81
"error_type" : "json error"
84
"error_message" : "table must be specified in URI query string.",
85
"error_type" : "http error"
88
"error_message" : "table must be specified in URI query string.",
89
"error_type" : "http error"
100
"firstname" : "Henrik",
108
"firstname" : "Mohit",
109
"lastname" : "Srivastava"
121
"firstname" : "Henrik",
129
"firstname" : "Mohit",
130
"lastname" : "Srivastava"
142
"firstname" : "Henrik",
150
"firstname" : "Mohit",
151
"lastname" : "Srivastava"
157
SET GLOBAL json_server_schema="json";
164
"firstname" : "Henrik",
172
"firstname" : "Mohit",
173
"lastname" : "Srivastava"
179
SET GLOBAL json_server_table="people";
186
"firstname" : "Henrik",
194
"firstname" : "Mohit",
195
"lastname" : "Srivastava"
202
"error_message" : "* Line 1, Column 19\n Missing ',' or '}' in object declaration\n",
203
"error_type" : "json error"
220
"firstname" : "Henrik",
224
"dob" : "16-feb-1977",
225
"interest" : "opensource",
241
"firstname" : "Mohit",
242
"lastname" : "Srivastava"
255
"error_message" : "_id must be specified in URI query string or set --json_server.allow_drop_table =true",
256
"error_type" : "http error"
259
"error_message" : "_id must be specified in URI query string or set --json_server.allow_drop_table =true",
260
"error_type" : "http error"
263
"error_message" : "_id must be specified in URI query string or set --json_server.allow_drop_table =true",
264
"error_type" : "http error"
267
"error_message" : "_id must be specified in URI query string or set --json_server.allow_drop_table =true",
268
"error_type" : "http error"
270
SET GLOBAL json_server_allow_drop_table="ON";
276
"error_message" : "Unknown table 'json.people'",
277
"error_type" : "sql error",
278
"internal_sql_query" : "SELECT * FROM `json`.`people`;",
280
"sqlstate" : "00000",
286
SET GLOBAL json_server_allow_drop_table="OFF";
287
SET GLOBAL json_server_table="";
288
SET GLOBAL json_server_schema="test";