summaryrefslogtreecommitdiff
path: root/cdr/cdr_tds.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2008-06-29 13:11:55 +0000
committerSean Bright <sean@malleable.com>2008-06-29 13:11:55 +0000
commite41a7c3d5129a02a3ca2c39459b432e6e2e099a0 (patch)
tree64bd803a40e394386d6d3d25317bffa294c8b662 /cdr/cdr_tds.c
parenta768ae2122fd823ca1a1577ece5217e349d29abb (diff)
While we're at it, escape all the columns in our TDS queries as well. Double
quotes seems to be more standard than square brackets (Sybase and SQL Server both support them). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@126312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr/cdr_tds.c')
-rw-r--r--cdr/cdr_tds.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/cdr/cdr_tds.c b/cdr/cdr_tds.c
index 2f17cac2d..928730898 100644
--- a/cdr/cdr_tds.c
+++ b/cdr/cdr_tds.c
@@ -136,25 +136,25 @@ static int tds_log(struct ast_cdr *cdr)
}
erc = dbfcmd(settings->dbproc,
- "INSERT INTO %s "
+ "INSERT INTO \"%s\" "
"("
- "accountcode, "
- "src, "
- "dst, "
- "dcontext, "
- "clid, "
- "channel, "
- "dstchannel, "
- "lastapp, "
- "lastdata, "
- "start, "
- "answer, "
- "[end], "
- "duration, "
- "billsec, "
- "disposition, "
- "amaflags, "
- "uniqueid"
+ "\"accountcode\", "
+ "\"src\", "
+ "\"dst\", "
+ "\"dcontext\", "
+ "\"clid\", "
+ "\"channel\", "
+ "\"dstchannel\", "
+ "\"lastapp\", "
+ "\"lastdata\", "
+ "\"start\", "
+ "\"answer\", "
+ "\"end\", "
+ "\"duration\", "
+ "\"billsec\", "
+ "\"disposition\", "
+ "\"amaflags\", "
+ "\"uniqueid\""
") "
"VALUES "
"("
@@ -317,7 +317,7 @@ static int mssql_connect(void)
goto failed;
}
- if (dbfcmd(settings->dbproc, "SELECT 1 FROM [%s]", settings->table) == FAIL) {
+ if (dbfcmd(settings->dbproc, "SELECT 1 FROM \"%s\"", settings->table) == FAIL) {
ast_log(LOG_ERROR, "Unable to build query while verifying the existence of table '%s'\n", settings->table);
goto failed;
}