Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#31 Bug in org.hsqldb.util.TransferDb.putData()

open-fixed
Fred Toussi
None
1
2005-03-26
2004-12-17
Anonymous
No

local variable tmpTypes gets filled wrong

current code:
...
int i = 0;
int tmpLength;
int len = r.getColumnCount();
int[] tmpTypes = null;

while (r.next()) {
if (tmpTypes == null) {
tmpTypes = new int[len + 1];

for (int j = 1; j <= len; j++) {
tmpTypes[i] = r.getColumnType(j);
}
}
...

correct working code (take a close look at the index
which is used to acces an element in tmpTypes):
...
int i = 0;
int tmpLength;
int len = r.getColumnCount();
int[] tmpTypes = null;

while (r.next()) {
if (tmpTypes == null) {
tmpTypes = new int[len + 1];

for (int j = 1; j <= len; j++) {
tmpTypes[j] = r.getColumnType(j);
}
}
...

Discussion

  • Fred Toussi
    Fred Toussi
    2005-03-26

    • labels: 325100 -->
    • priority: 5 --> 1
    • assigned_to: nobody --> fredt
    • status: open --> open-fixed
     
  • Fred Toussi
    Fred Toussi
    2005-03-26

    Logged In: YES
    user_id=150940

    Thanks, patch applied to 1.8.0 code.