fix in sql_input stream
Added debugging