I updated to 4.2.2
I have a simple php application which allows a user to enter sql and execute it.
Under 4.2.0 this works as expected.
Under 4.2.2, strange behaviour - but ONLY when I mix User-Defined Functions (UDFs) with simple table columns. One or the other (i.e. all columns or all UDFs) is fine. Mixed - no rows.
So,
SELECT COL_A FROM ATABLE works
SELECT MY_UDF(COL_A) FROM ATABLE works
SELECT COL_A, 'A Literal String', 123 FROM ATABLE works
SELECT MY_UDF(COL_A), 'A Literal String', 123 FROM ATABLE works
SELECT COL_A, MY_UDF(COL_A) FROM ATABLE returns an empty result set in 4.2.2, but works in 4.2.0
I can replicate the behaviour by changing php to/from 4.2.0 & 4.2.2
Any ideas / suggestions greatly appreciated.
The php code which does the work is simply
$res_id = odbc_exec($dsn, $tmp_sql_text);
if ($res_id)
{
echo "<tr>";
$col_ctr = odbc_num_fields($res_id);
for ($idx = 0; $idx < $col_ctr; ++$idx)
{
echo "<td><font size='2'>";
echo odbc_field_name($res_id, ($idx + 1));
echo "</font></td>";
}
echo "</tr>";
while ( $cols = odbc_fetch_into($res_id, $row) )
{
$res_set[] = $row;
++$row_ctr;
} // endwhile
htmlTableRowOutput::htmlTableRowOutput($res_set);
odbc_free_result($res_id);
} //endif $res_id
When I display $res_id I get e.g. Resource ID#2 under 4.2.0 and 4.2.2, which suggests that the odbc_exec() was successful.
When I display $col_ctr, the correct number is displayed in both cases, AND the column names are output correctly.
However, 4.2.2 always returns an empty value for $cols = odbc_fetch_into($res_id, $row) on the first call.
I have run the same php under 4.2.0 and 4.2.2 against multiple databases wth the same behaviour.