[Kexi-devel] [PATCH] mdbtools: mdb_set_encoding

Martin Ellis martin.ellis at kdemail.net
Tue Dec 20 02:05:30 CET 2005


On Tuesday 20 December 2005 00:53, Martin Ellis wrote:
> I get a crash on importing Northwind after this.  I never used to get that.

From the debug output, looks like this is the cause:

  KexiDB::IndexSchema* p_idx = new KexiDB::IndexSchema(table);
  for (unsigned int i = 0; i < idx->num_keys; i++) {
    key_col_num[i] = idx->key_col_num[i];
    kdDebug() << kdLoc << "key " << i + 1
              << " col " << key_col_num[i]
              << table->field(idx->key_col_num[i-1])->name()
              << endl;
    p_idx->addField(table->field(idx->key_col_num[i-1]));
  }

What's the i-1 there?  That doesn't make sense if 'i' starts at 0, 
and is an unsigned array index.

Martin



More information about the Kexi-devel mailing list