ESQL/C 5.01 Bug with SELECT and arrays used in WHERE qualification
Posted in 1994
My collegue, Bruce Munro, noticed the following effect whilst recompiling with 5.01 under HP/UX 9.01 on HP 9000/715 :- $select * into $a_record from a_table where a_column=$array1[array2[0]]; is translated to /* * $select * into $a_record from a_table where a_column=$array1[array2[0]]; */ #line 9 "ms.ec" { #line 9 "ms.ec" static char *sqlcmdtxt[] = #line 9 "ms.ec" { #line 9 "ms.ec" " select * from a_table where a_column = ?", 0 }; #line 9 "ms.ec" static _SQCURSOR _SQ0 = {0}; static struct sqlvar_struct _sqibind[] = { { 102, sizeof(array1[array20]), 0, 0, 0, 0, 0, 0, 0 }, #line 9 "ms.ec" }; static struct sqlvar_struct _sqobind[] = { { 102, sizeof(a_record), 0, 0, 0, 0, 0, 0, 0 }, #line 9 "ms.ec" }; #line 9 "ms.ec" _sqibind[0].sqldata = (char *) &array1[array20]; <==== ERROR HERE #line 9 "ms.ec" _sqobind[0].sqldata = (char *) &a_record; #line 9 "ms.ec" _iqslct(&_SQ0, sqlcmdtxt, 1, _sqibind, 1, _sqobind, 0); #line 9 "ms.ec" } } The C colpiler complains because array2[0] is translated to array20 which is an undefined variable. Informix presently believe this is a bug and are in the process of raising a bug number.