Index: kexi/migration/mdb/src/keximdb/mdbmigrate.cpp =================================================================== --- kexi/migration/mdb/src/keximdb/mdbmigrate.cpp (revision 1151353) +++ kexi/migration/mdb/src/keximdb/mdbmigrate.cpp (revision 1151354) @@ -264,7 +264,15 @@ //! Bind + allocate the DB columns to columnData and columnDataLength arrays mdb_read_columns(tableDef); // mdb_bind_column dies without this for (unsigned int i = 0; i < tableDef->num_cols; i++) { - columnData[i] = (char*) g_malloc(MDB_BIND_SIZE); + MdbColumn *col = (MdbColumn*) g_ptr_array_index(tableDef->columns, i); + if (col->col_type == MDB_MEMO) { +//! @todo supporting 1GB (possible to insert programmatically) of MEMO field needs changes in mdbtools API; +//! for now 65,535 is supported (maximum when entering data through the user interface) + columnData[i] = (char*) g_malloc(0x10000); + } + else { + columnData[i] = (char*) g_malloc(MDB_BIND_SIZE); + } // Columns are numbered from 1 // and why aren't these unsigned ints? Index: kexi/migration/mdb/src/mdbtools/libmdb/data.c =================================================================== --- kexi/migration/mdb/src/mdbtools/libmdb/data.c (revision 1151353) +++ kexi/migration/mdb/src/mdbtools/libmdb/data.c (revision 1151354) @@ -223,12 +223,19 @@ char *str; if (col->col_type == MDB_NUMERIC) { + /*fprintf(stdout,"MDB_NUMERIC\n");*/ str = mdb_num_to_string(mdb, start, col->col_type, col->col_prec, col->col_scale); + /*fprintf(stdout,"mdb_num_to_string()=%d '%s'\n", strlen(str), str);*/ } else { + /*fprintf(stdout,"!MDB_NUMERIC : %d len=%d\n", col->col_type, len);*/ str = mdb_col_to_string(mdb, mdb->pg_buf, start, col->col_type, len); + /*if (strlen(str) > MDB_BIND_SIZE) { + fprintf(stdout, "!!!!!!\n"); + } + fprintf(stdout,"mdb_col_to_string()=%d '%s'\n", strlen(str), str);*/ } strcpy(col->bind_ptr, str); g_free(str); @@ -610,9 +617,11 @@ gint32 row_start, pg_row; size_t len; void *buf, *pg_buf = mdb->pg_buf; - char *text = (char *) g_malloc(MDB_BIND_SIZE); + char *text = 0; + /*printf("mdb_memo_to_string: size=%d\n", size);*/ if (size