Escape column names in CREATE

Fixes #33

Add test case with a hyphen and an embedded quotation mark
This commit is contained in:
Colin Dellow 2018-07-08 10:37:18 -04:00
parent 65e47e5828
commit d3128498b1
2 changed files with 10 additions and 1 deletions

Binary file not shown.

View File

@ -52,7 +52,16 @@ std::string ParquetTable::CreateStatement() {
if(i > 0) if(i > 0)
text += ", "; text += ", ";
text += col->name(); text += "\"";
// Horrifically inefficient, but easy to understand.
std::string colName = col->name();
for(char& c : colName) {
if(c == '"')
text += "\"\"";
else
text += c;
}
text += "\"";
std::string type; std::string type;