Hello Andrew,
the following model code creates a segmentation fault:
table ta { l in LOCATIONS } OUT
'iODBC'
'DSN=glpk;UID=glpk;PWD=gnu'
'UPDATE result_t12 SET DATE = ' & date & ' WHERE ID = 4'
'UPDATE result_t12 SET QUAN = ? WHERE LOC = ? AND ID = 4' :
quantity[l], l, 4 ~ id;
The number of parameters is higher than the number of '?' in the SQL statement.
Please, apply the patch below.
Best regards
Xypron
--- glpk/glpk/trunk/glpk-4.31/src/glpsql.c 2008/08/28 17:07:42 273
+++ glpk/glpk/branches/glpk-4.31-segmentation_fault/src/glpsql.c
2008/09/16 21:59:48 282
@@ -819,7 +819,8 @@
xassert(dca != dca);
}
}
- strcat(query, part);
+ if (part != NULL)
+ strcat(query, part);
if (dl_SQLExecDirect(sql->hstmt, (SQLCHAR *) query, SQL_NTS)
!= SQL_SUCCESS)
{
@@ -1401,7 +1402,8 @@
xassert(dca != dca);
}
}
- strcat(query, part);
+ if (part != NULL)
+ strcat(query, part);
if (dl_mysql_query(sql->con, query))
{
xprintf("db_mysql_write: Query\n\"%s\"\nfailed.\n", query);
--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen:
http://www.gmx.net/de/go/multimessenger
_______________________________________________
Bug-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-glpk