JNI wrapper1: when checking for an out-of-bounds statement column index, perform the is-statement-finalized check before the range check so that the former exception trumps the latter.

FossilOrigin-Name: 0832f9a8e9f574b157c791c5cddc73aff7b2ff403509f5d78f310494d4a7f93d
This commit is contained in:
stephan 2023-11-11 14:50:01 +00:00
parent 307f95c1e4
commit 56e1610f7a
3 changed files with 8 additions and 8 deletions

View File

@ -979,7 +979,7 @@ public final class Sqlite implements AutoCloseable {
/** Throws if n is out of range of this statement's result column
count. Intended to be used by the columnXyz() methods. */
private sqlite3_stmt checkColIndex(int n){
if(null==stmt || n<0 || n>=columnCount()){
if(n<0 || n>=columnCount()){
throw new IllegalArgumentException("Column index "+n+" is out of range.");
}
return thisStmt();

View File

@ -1,5 +1,5 @@
C Do\snot\scache\sa\sstatement's\scolumn\scount\sin\sthe\sJNI\swrapper1\sAPI\sbecause\san\sALTER\sTABLE\svia\sanother\sstatement\smay\sinvalidate\sit,\sas\sreported\sin\s[forum:6d80efd58d4591c7|forum\spost\s6d80efd58d4591c7].
D 2023-11-11T14:43:50.704
C JNI\swrapper1:\swhen\schecking\sfor\san\sout-of-bounds\sstatement\scolumn\sindex,\sperform\sthe\sis-statement-finalized\scheck\sbefore\sthe\srange\scheck\sso\sthat\sthe\sformer\sexception\strumps\sthe\slatter.
D 2023-11-11T14:50:01.933
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -296,7 +296,7 @@ F ext/jni/src/org/sqlite/jni/test-script-interpreter.md f9f25126127045d051e918fe
F ext/jni/src/org/sqlite/jni/wrapper1/AggregateFunction.java d5c108b02afd3c63c9e5e53f71f85273c1bfdc461ae526e0a0bb2b25e4df6483
F ext/jni/src/org/sqlite/jni/wrapper1/ScalarFunction.java 43c43adfb7866098aadaaca1620028a6ec82d5193149970019b1cce9eb59fb03
F ext/jni/src/org/sqlite/jni/wrapper1/SqlFunction.java 27b141f5914c7cb0e40e90a301d5e05b77f3bd42236834a68031b7086381fafd
F ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java 08a5037aaa5bc83d87f5389adce39c747835c210c445ff02669280e5cc7ffed1
F ext/jni/src/org/sqlite/jni/wrapper1/Sqlite.java aeaec95323a8186d0b8e741affff067fe893849a2d862acd443373035c7b73a0
F ext/jni/src/org/sqlite/jni/wrapper1/SqliteException.java 982538ddb4c0719ef87dfa664cd137b09890b546029a7477810bd64d4c47ee35
F ext/jni/src/org/sqlite/jni/wrapper1/Tester2.java 40806dbbf8e120f115e33255d1813db13b40f0a598869e299a947a580429939b
F ext/jni/src/org/sqlite/jni/wrapper1/ValueHolder.java 7b89a7391f771692c5b83b0a5b86266abe8d59f1c77d7a0eccc9b79f259d79af
@ -2139,8 +2139,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P f1eae192315335d7e385b0a801a17700a9718d245bda6628518c5df9a1e9d3d6
R 6d2e0ef8621cb43b22b4fb0195114a8a
P a6ab88e9a67f23ab7885402776282b94033cb48dbe34d4d18356e4dc22aae7cd
R 78a63cfa87011ebb24c6cac260db14c9
U stephan
Z 23f634cb68b0506eca8a1295175f53ed
Z ad92dad6ace48bd20f7cf67cbd6f4f40
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
a6ab88e9a67f23ab7885402776282b94033cb48dbe34d4d18356e4dc22aae7cd
0832f9a8e9f574b157c791c5cddc73aff7b2ff403509f5d78f310494d4a7f93d