~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Stewart Smith
  • Date: 2011-05-02 07:46:14 UTC
  • mto: This revision was merged to the branch mainline in revision 2310.
  • Revision ID: stewart@flamingspork.com-20110502074614-cqogjkkndekg0hv1
use http_post() function to test json_server

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
4
{
3
5
   "query" : "select * from t1;",
4
6
   "result_set" : [
6
8
   ],
7
9
   "sqlstate" : "00000"
8
10
}
 
11
 
9
12
insert into t1 (b) values ("from MySQL protocol");
 
13
select http_post('http://localhost:PORT/0.1/sql', 'select * from t1;');;
 
14
http_post('http://localhost:PORT/0.1/sql', 'select * from t1;')
10
15
{
11
16
   "query" : "select * from t1;",
12
17
   "result_set" : [
15
20
   ],
16
21
   "sqlstate" : "00000"
17
22
}
 
23
 
 
24
select http_post('http://localhost:PORT/0.1/sql', 'insert into t1 (b) values (\'from http\');');;
 
25
http_post('http://localhost:PORT/0.1/sql', 'insert into t1 (b) values (\'from http\');')
18
26
{
19
 
   "error_code" : 1064,
20
 
   "error_message" : "You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'from http' at line 1",
21
 
   "query" : "insert into t1 (b) values (\"from http\";",
 
27
   "query" : "insert into t1 (b) values ('from http');",
22
28
   "sqlstate" : "00000"
23
29
}
 
30
 
24
31
SELECT * from t1;
25
32
a       b
26
33
1       from MySQL protocol
 
34
2       from http
27
35
drop table t1;