Update of /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14698/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel
Modified Files:
SQLResultExecuterPanel.java
Log Message:
1704798 (ISQLExecutionListeners cannot return "null"). Properly handle the case where an ISQLExecutionListener returns null
for statementExecuting() to indicate that the statement should not be executed. In this case, skip the execution, but log it at
INFO so that we can effectively troubleshoot any plugins that do this unexpectedly.
Index: SQLResultExecuterPanel.java
===================================================================
RCS file: /cvsroot/squirrel-sql/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SQLResultExecuterPanel.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** SQLResultExecuterPanel.java 17 Mar 2007 23:53:37 -0000 1.36
--- SQLResultExecuterPanel.java 21 Apr 2007 13:17:02 -0000 1.37
***************
*** 279,283 ****
--- 279,295 ----
if (sql != null && sql.trim().length() > 0)
{
+ String origSQL = sql;
sql = fireSQLToBeExecutedEvent(sql);
+
+ // This can happen if an impl of ISQLExecutionListener returns null
+ // from the statementExecuting API method, to indicate that the SQL
+ // shouldn't be executed.
+ if (sql == null) {
+ s_log.info(
+ "executeSQL: An ISQLExecutionListener veto'd execution of "+
+ "the following SQL: "+origSQL);
+ return;
+ }
+
ISQLExecutionListener[] executionListeners =
_listeners.getListeners(ISQLExecutionListener.class);
|