Skip to content

Commit

Permalink
added a test case for weird table column names.
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Aug 30, 2011
1 parent 548ec87 commit f24f400
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
50 changes: 50 additions & 0 deletions t/000_init.t
Expand Up @@ -128,3 +128,53 @@ GET /init
--- error_code: 200
--- timeout: 10
=== TEST 8: birds - drop table
--- http_config eval: $::http_config
--- config
location = /init {
drizzle_pass database;
drizzle_query "DROP TABLE IF EXISTS birds";
}
--- request
GET /init
--- error_code: 200
--- timeout: 10
=== TEST 9: birds - create table
--- http_config eval: $::http_config
--- config
location = /init {
drizzle_pass database;
drizzle_query "CREATE TABLE birds (`\"name\"` text, height real)";
}
--- request
GET /init
--- error_code: 200
--- timeout: 10
=== TEST 10: birds - insert values
--- http_config eval: $::http_config
--- config
location = /init {
drizzle_pass database;
drizzle_query "
INSERT INTO birds (`\"name\"`, height)
VALUES
('hello \"tom', 3.14),
('hi,ya', -3),
('hey\\ndad', 7),
('\\rkay', 0.005),
('ab;c', 0.005),
('foo\\tbar', 21);";
}
--- request
GET /init
--- error_code: 200
--- timeout: 10
24 changes: 23 additions & 1 deletion t/escape.t
Expand Up @@ -290,7 +290,8 @@ dad"\t7
}
=== TEST 9: set content type (bigger buffer size)
=== TEST 10: set content type (bigger buffer size)
--- http_config eval: $::http_config
--- config
location /mysql {
Expand Down Expand Up @@ -319,3 +320,24 @@ dad"\t7
1\thi,ya\t-3
}
=== TEST 11: escaping column names
--- http_config eval: $::http_config
--- config
location /mysql {
drizzle_query "
select `\"name\"`, height from birds order by height limit 1;
";
drizzle_pass backend;
rds_csv on;
rds_csv_row_terminator "\n";
}
--- request
GET /mysql
--- response_headers
Content-Type: text/csv; header=presence
--- response_body
"""name""",height
"hi,ya",-3

0 comments on commit f24f400

Please sign in to comment.