Merged revisions 310142 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r310142 | tilghman | 2011-03-09 23:53:29 -0600 (Wed, 09 Mar 2011) | 19 lines Merged revisions 310141 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r310141 | tilghman | 2011-03-09 23:51:37 -0600 (Wed, 09 Mar 2011) | 12 lines Merged revisions 310140 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r310140 | tilghman | 2011-03-09 23:38:44 -0600 (Wed, 09 Mar 2011) | 5 lines Initialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems. (closes issue #18295) Reported by: pruiz ........ ................ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@310143 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
cb8c826815
commit
781b6a189e
|
@ -3336,6 +3336,7 @@ static int retrieve_file(char *dir, int msgnum)
|
|||
fprintf(f, "[message]\n");
|
||||
for (x = 0; x < colcount; x++) {
|
||||
rowdata[0] = '\0';
|
||||
colsize = 0;
|
||||
collen = sizeof(coltitle);
|
||||
res = SQLDescribeCol(stmt, x + 1, (unsigned char *) coltitle, sizeof(coltitle), &collen,
|
||||
&datatype, &colsize, &decimaldigits, &nullable);
|
||||
|
|
|
@ -589,7 +589,7 @@ static int acf_odbc_read(struct ast_channel *chan, const char *cmd, char *s, cha
|
|||
|
||||
if (y == 0) {
|
||||
char colname[256];
|
||||
SQLULEN maxcol;
|
||||
SQLULEN maxcol = 0;
|
||||
|
||||
res = SQLDescribeCol(stmt, x + 1, (unsigned char *)colname, sizeof(colname), &collength, NULL, &maxcol, NULL, NULL);
|
||||
ast_debug(3, "Got collength of %d and maxcol of %d for column '%s' (offset %d)\n", (int)collength, (int)maxcol, colname, x);
|
||||
|
@ -1197,6 +1197,8 @@ static char *cli_odbc_read(struct ast_cli_entry *e, int cmd, struct ast_cli_args
|
|||
}
|
||||
for (;;) {
|
||||
for (x = 0; x < colcount; x++) {
|
||||
maxcol = 0;
|
||||
|
||||
res = SQLDescribeCol(stmt, x + 1, (unsigned char *)colname, sizeof(colname), &collength, NULL, &maxcol, NULL, NULL);
|
||||
if (((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) || collength == 0) {
|
||||
snprintf(colname, sizeof(colname), "field%d", x);
|
||||
|
|
|
@ -238,6 +238,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
|
|||
}
|
||||
for (x = 0; x < colcount; x++) {
|
||||
rowdata[0] = '\0';
|
||||
colsize = 0;
|
||||
collen = sizeof(coltitle);
|
||||
res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen,
|
||||
&datatype, &colsize, &decimaldigits, &nullable);
|
||||
|
@ -410,6 +411,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char *
|
|||
}
|
||||
for (x=0;x<colcount;x++) {
|
||||
rowdata[0] = '\0';
|
||||
colsize = 0;
|
||||
collen = sizeof(coltitle);
|
||||
res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen,
|
||||
&datatype, &colsize, &decimaldigits, &nullable);
|
||||
|
|
Reference in New Issue