From: <le...@us...> - 2008-07-01 23:38:40
|
Revision: 4835 http://jython.svn.sourceforge.net/jython/?rev=4835&view=rev Author: leosoto Date: 2008-07-01 16:38:37 -0700 (Tue, 01 Jul 2008) Log Message: ----------- zxJDBC: Avoid preparing a statement when executemany() is called with an empty sequence Modified Paths: -------------- branches/asm/src/com/ziclix/python/sql/PyCursor.java Modified: branches/asm/src/com/ziclix/python/sql/PyCursor.java =================================================================== --- branches/asm/src/com/ziclix/python/sql/PyCursor.java 2008-07-01 22:24:50 UTC (rev 4834) +++ branches/asm/src/com/ziclix/python/sql/PyCursor.java 2008-07-01 23:38:37 UTC (rev 4835) @@ -506,7 +506,11 @@ * @param maxRows */ public void executemany(PyObject sql, PyObject params, PyObject bindings, PyObject maxRows) { - execute(sql, params, bindings, maxRows); + if (isSeq(params) && params.__len__() == 0) { + //executemany with an empty params tuple is a no-op + return; + } + execute(sql, params, bindings, maxRows); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |