mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +08:00
lots of small fixes (see Changelog)
This commit is contained in:
parent
9813d08844
commit
4bb08b6661
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
||||
Sat Mar 13 09:27:23 EST 2004 Brian Bruns <brian@bruns.com>
|
||||
* doc/faq.html: fix typos, add question on write support
|
||||
* doc/install.sgml: clarify yacc requirement
|
||||
* doc/mdb-ver.txt: add -M to options
|
||||
* doc/mdb-sql.txt: add BUGS sections
|
||||
* src/libmdb/data.c: fix bug in call to mdb_get_double (Jeff Smith)
|
||||
* src/libmdb/write.c: move declaration to top of function in crack_row3 (Jeff Smith), check for null in mdb_pack_row[3-4] (me)
|
||||
* src/libmdb/index.c: fix hard coded index size in compressed index handling
|
||||
* src/sql/lexer.l: missing ] in NUMBER (Jeff Smith)
|
||||
* src/sql/mdbsql.c: temp_fill called with wrong value (Jeff Smith)
|
||||
* src/odbc/odbc.c: fix typo, incorrect pointer dereference (Jeff Smith), change value to SQLSMALLINT * in type_info
|
||||
|
||||
Sat Mar 6 18:10:20 EST 2004 Brian Bruns <brian@bruns.com>
|
||||
* include/mdbsql.h:
|
||||
* src/libmdb/worktable.c:
|
||||
|
11
doc/faq.html
11
doc/faq.html
@ -24,7 +24,9 @@
|
||||
</dd><dd>
|
||||
<a href="#help">1.9 How do I help?</a>
|
||||
</dd><dd>
|
||||
<a href="#help">1.10 What's this postcard thing?</a>
|
||||
<a href="#postcards">1.10 What's this postcard thing?</a>
|
||||
</dd><dd>
|
||||
<a href="#writing">1.11 When will MDB Tools support writing?</a>
|
||||
</dd></dl>
|
||||
|
||||
<hr size="1">
|
||||
@ -64,7 +66,7 @@ MDB Tools supports Jet version 3.0 and 4.0 databases. It does not, and probably
|
||||
<li>Add support for adding rows to existing tables and an mdb-import tool.</li>
|
||||
<li>Add full write support to libmdb and libmdbsql.</li>
|
||||
<li>Extract queries, table properties, VBA script, forms.</li>
|
||||
<li>mdb-check database consistancy checker and recovery tool.</li>
|
||||
<li>mdb-check database consistency checker and recovery tool.</li>
|
||||
<li>Add joins.</li>
|
||||
<li>Ability to add tables.</li>
|
||||
</ul>
|
||||
@ -96,7 +98,10 @@ We are currently looking for corrupted Access databases to help with developing
|
||||
</p>
|
||||
</dd></dl>
|
||||
<dl><a name="postcards"></a><dt><b>1.10 What's this postcard thing?</b></dt><dd>
|
||||
I, like many free software others, enjoy getting postcards from where users live. If you're a happy MDB Tools user (or even a disgruntled one, doesn't really matter) and want to drop me a postcard with a picture of the place you live, email <a href="mailto:brian@nospam.bruns.com">me</a> for my snail-mail address. Come one, you know you want to!
|
||||
I, like many free software others, enjoy getting postcards from where users live. If you're a happy MDB Tools user (or even a disgruntled one, doesn't really matter) and want to drop me a postcard with a picture of the place you live, email <a href="mailto:brian@nospam.bruns.com">me</a> for my snail-mail address. Come on, you know you want to!
|
||||
</dd></dl>
|
||||
<dl><a name="writing"></a><dt><b>1.11 When will MDB Tools support writing?</b></dt><dd>
|
||||
Writing to MDB files is a quite a bit more complicated than simply reading. Some preliminary support is available in the CVS version, this includes under-the-covers things like building rows, adding rows to tables, tracing the index chain to the row, and some work on index writes. These are the nuts and bolts of write support; the big thing left is the allocation of new pages and splitting full pages on inserts. When will this be done? I don't commit to timelines, but the next release (0.6) will have some usable, though not complete, write support.
|
||||
</dd></dl>
|
||||
|
||||
</body></html>
|
||||
|
@ -2,8 +2,8 @@
|
||||
]>
|
||||
<book>
|
||||
<bookinfo>
|
||||
<date>$Date: 2004/02/08 18:41:07 $</date>
|
||||
<releaseinfo>$Revision: 1.3 $</releaseinfo>
|
||||
<date>$Date: 2004/03/13 15:07:19 $</date>
|
||||
<releaseinfo>$Revision: 1.4 $</releaseinfo>
|
||||
<title><productname>MDB Tools</productname> Installation Guide</title>
|
||||
<subtitle>A Guide to Installing and Configuring <productname>MDB Tools</productname></subtitle>
|
||||
<author>
|
||||
@ -34,9 +34,9 @@ This guide is intended to provide help with installing and configuring the <prod
|
||||
<para>
|
||||
A few technical notes. This guide is written in SGML DocBook format, specifications for which are found in the <ulink url="http://www.docbook.org/tdg/en/html/docbook.html">DocBook book</ulink>. It was converted to HTML with <ulink url="http://openjade.sourceforge.net">OpenJade</ulink>.
|
||||
The document you are reading is version
|
||||
$Revision: 1.3 $
|
||||
$Revision: 1.4 $
|
||||
, dated
|
||||
$Date: 2004/02/08 18:41:07 $ (CVS control number $Id: install.sgml,v 1.3 2004/02/08 18:41:07 brianb Exp $). The most recent version can be found on the <productname>MDB Tools</productname>
|
||||
$Date: 2004/03/13 15:07:19 $ (CVS control number $Id: install.sgml,v 1.4 2004/03/13 15:07:19 brianb Exp $). The most recent version can be found on the <productname>MDB Tools</productname>
|
||||
<ulink url="http://mdbtools.sourceforge.net/userguide/">web site</ulink>.
|
||||
</para>
|
||||
</preface>
|
||||
@ -183,7 +183,7 @@ The following matrix lists all requirements and which features they affect. An
|
||||
<entry>Supports history in mdb-sql, will compile without history if not found.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bison</entry>
|
||||
<entry>bison/yacc</entry>
|
||||
<entry>X</entry>
|
||||
<entry>X</entry>
|
||||
<entry></entry>
|
||||
|
@ -65,3 +65,4 @@ AUTHORS
|
||||
The mdb-sql utility was written by Brian Bruns
|
||||
|
||||
BUGS
|
||||
The supported SQL syntax is a very limited subset and deficient in several ways.
|
||||
|
@ -10,6 +10,8 @@ DESCRIPTION
|
||||
|
||||
OPTIONS
|
||||
|
||||
-M Prints the version of MDB Tools itself instead of the MDB file.
|
||||
|
||||
NOTES
|
||||
Access changed its format between Jet 3 used in Access 97 and Jet 4 used for Access 2000 and XP. The nature of the changes included moving the page size from 2K to 4K and added support for unicode. MDB Tools actively supports both formats.
|
||||
|
||||
|
@ -1073,7 +1073,7 @@ char *mdb_col_to_string(MdbHandle *mdb, unsigned char *buf, int start, int datat
|
||||
return text;
|
||||
break;
|
||||
case MDB_SDATETIME:
|
||||
td = mdb_get_double(mdb, start);
|
||||
td = mdb_get_double(mdb->pg_buf, start);
|
||||
if (td > 1) {
|
||||
t = (long int)((td - 25569.0) * 86400.0);
|
||||
} else {
|
||||
|
@ -571,6 +571,7 @@ mdb_index_find_next(MdbHandle *mdb, MdbIndex *idx, MdbIndexChain *chain, guint32
|
||||
int passed = 0;
|
||||
int idx_sz;
|
||||
int idx_start = 0;
|
||||
MdbColumn *col;
|
||||
|
||||
ipg = mdb_index_read_bottom_pg(mdb, idx, chain);
|
||||
|
||||
@ -608,8 +609,10 @@ mdb_index_find_next(MdbHandle *mdb, MdbIndex *idx, MdbIndexChain *chain, guint32
|
||||
*row = mdb->pg_buf[ipg->offset + ipg->len - 1];
|
||||
*pg = mdb_pg_get_int24_msb(mdb, ipg->offset + ipg->len - 4);
|
||||
//printf("row = %d pg = %lu ipg->pg = %lu offset = %lu len = %d\n", *row, *pg, ipg->pg, ipg->offset, ipg->len);
|
||||
idx_sz = 4;
|
||||
if (ipg->len - 4 < idx_sz) {
|
||||
col=g_ptr_array_index(idx->table->columns,idx->key_col_num[0]-1);
|
||||
idx_sz = mdb_col_fixed_size(col);
|
||||
/* handle compressed indexes, single key indexes only? */
|
||||
if (idx->num_keys==1 && idx_sz>0 && ipg->len - 4 < idx_sz) {
|
||||
//printf("short index found\n");
|
||||
//buffer_dump(ipg->cache_value, 0, idx_sz);
|
||||
memcpy(&ipg->cache_value[idx_sz - (ipg->len - 4)], &mdb->pg_buf[ipg->offset], ipg->len);
|
||||
|
@ -215,7 +215,7 @@ mdb_crack_row3(MdbTableDef *table, int row_start, int row_end, MdbField *fields)
|
||||
int byte_num, bit_num;
|
||||
int num_of_jumps = 0, jumps_used = 0;
|
||||
int eod, len; /* end of data */
|
||||
int row_pos;
|
||||
int row_pos, col_ptr;
|
||||
|
||||
if (mdb_get_option(MDB_DEBUG_ROW)) {
|
||||
buffer_dump(mdb->pg_buf, row_start, row_end+1);
|
||||
@ -283,7 +283,7 @@ mdb_crack_row3(MdbTableDef *table, int row_start, int row_end, MdbField *fields)
|
||||
}
|
||||
|
||||
/* if fixed columns add up to more than 256, we need a jump */
|
||||
int col_ptr = row_end - bitmask_sz - num_of_jumps - 1;
|
||||
col_ptr = row_end - bitmask_sz - num_of_jumps - 1;
|
||||
if (col_start >= 256) {
|
||||
num_of_jumps++;
|
||||
jumps_used++;
|
||||
@ -406,8 +406,10 @@ mdb_pack_row4(MdbTableDef *table, unsigned char *row_buffer, int num_fields, Mdb
|
||||
if (!fields[i].is_fixed) {
|
||||
var_cols++;
|
||||
fields[i].offset = pos;
|
||||
memcpy(&row_buffer[pos], fields[i].value, fields[i].siz);
|
||||
pos += fields[i].siz;
|
||||
if (! fields[i].is_null) {
|
||||
memcpy(&row_buffer[pos], fields[i].value, fields[i].siz);
|
||||
pos += fields[i].siz;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* EOD */
|
||||
@ -451,8 +453,10 @@ mdb_pack_row3(MdbTableDef *table, unsigned char *row_buffer, int num_fields, Mdb
|
||||
if (!fields[i].is_fixed) {
|
||||
var_cols++;
|
||||
fields[i].offset = pos;
|
||||
memcpy(&row_buffer[pos], fields[i].value, fields[i].siz);
|
||||
pos += fields[i].siz;
|
||||
if (! fields[i].is_null) {
|
||||
memcpy(&row_buffer[pos], fields[i].value, fields[i].siz);
|
||||
pos += fields[i].siz;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* EOD */
|
||||
|
@ -7,7 +7,7 @@ MDBSOURCES = backend.c index.c money.c catalog.c kkd.c sargs.c \
|
||||
map.c props.c worktable.c options.c \
|
||||
write.c stats.c iconv.c
|
||||
|
||||
bin_PROGRAMS = unittest
|
||||
bin_PROGRAMS = unittest unittest2
|
||||
lib_LTLIBRARIES = libmdbodbc.la
|
||||
AM_CPPFLAGS = -I ../../include $(GLIB_CFLAGS)
|
||||
libmdbodbc_la_SOURCES= odbc.c connectparams.c
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include "connectparams.h"
|
||||
|
||||
static char software_version[] = "$Id: odbc.c,v 1.14 2004/03/06 23:59:54 brianb Exp $";
|
||||
static char software_version[] = "$Id: odbc.c,v 1.15 2004/03/13 15:07:19 brianb Exp $";
|
||||
static void *no_unused_var_warn[] = {software_version,
|
||||
no_unused_var_warn};
|
||||
|
||||
@ -68,16 +68,16 @@ typedef struct {
|
||||
SQLSMALLINT nullable;
|
||||
SQLSMALLINT case_sensitive;
|
||||
SQLSMALLINT searchable;
|
||||
SQLSMALLINT unsigned_attribute;
|
||||
SQLSMALLINT *unsigned_attribute;
|
||||
SQLSMALLINT fixed_prec_scale;
|
||||
SQLSMALLINT auto_unique_value;
|
||||
SQLCHAR *local_type_name;
|
||||
SQLSMALLINT minimum_scale;
|
||||
SQLSMALLINT maximum_scale;
|
||||
SQLSMALLINT sql_data_type;
|
||||
SQLSMALLINT sql_datetime_sub;
|
||||
SQLSMALLINT num_prec_radix;
|
||||
SQLSMALLINT interval_precision;
|
||||
SQLSMALLINT *sql_datetime_sub;
|
||||
SQLSMALLINT *num_prec_radix;
|
||||
SQLSMALLINT *interval_precision;
|
||||
} TypeInfo;
|
||||
|
||||
TypeInfo type_info[] = {
|
||||
@ -429,6 +429,7 @@ SQLRETURN SQL_API SQLAllocHandle(
|
||||
return _SQLAllocEnv(OutputHandle);
|
||||
break;
|
||||
}
|
||||
return SQL_ERROR;
|
||||
}
|
||||
static SQLRETURN SQL_API _SQLAllocConnect(
|
||||
SQLHENV henv,
|
||||
@ -696,7 +697,7 @@ SQLRETURN SQL_API SQLColAttributes(
|
||||
case SQL_COLUMN_LABEL:
|
||||
namelen = MIN(cbDescMax,strlen(sqlcol->name));
|
||||
strncpy(rgbDesc, sqlcol->name, namelen);
|
||||
*((char *)&rgbDesc[namelen])='\0';
|
||||
((char *)rgbDesc)[namelen]='\0';
|
||||
break;
|
||||
case SQL_COLUMN_TYPE:
|
||||
*pfDesc = SQL_CHAR;
|
||||
@ -1266,8 +1267,8 @@ SQLRETURN SQL_API SQLGetTypeInfo(
|
||||
MdbHandle *mdb = sql->mdb;
|
||||
unsigned char *new_pg;
|
||||
int row_size;
|
||||
unsigned char *row_buffer[MDB_PGSIZE];
|
||||
unsigned char *tmpstr[MDB_BIND_SIZE];
|
||||
unsigned char row_buffer[MDB_PGSIZE];
|
||||
unsigned char tmpstr[MDB_BIND_SIZE];
|
||||
int i, tmpsiz;
|
||||
MdbField fields[NUM_TYPE_INFO_COLS];
|
||||
|
||||
@ -1315,7 +1316,7 @@ SQLRETURN SQL_API SQLGetTypeInfo(
|
||||
mdb_fill_temp_field(&fields[6],&type_info[i].nullable, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[7],&type_info[i].case_sensitive, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[8],&type_info[i].searchable, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[9],&type_info[i].unsigned_attribute, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[9],type_info[i].unsigned_attribute, sizeof(SQLSMALLINT), 0,type_info[i].unsigned_attribute ? 0 : 1,0,1);
|
||||
mdb_fill_temp_field(&fields[10],&type_info[i].fixed_prec_scale, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[11],&type_info[i].auto_unique_value, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
tmpsiz = mdb_ascii2unicode(mdb, type_info[i].local_type_name, 0, 100, tmpstr);
|
||||
@ -1323,9 +1324,9 @@ SQLRETURN SQL_API SQLGetTypeInfo(
|
||||
mdb_fill_temp_field(&fields[13],&type_info[i].minimum_scale, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[14],&type_info[i].maximum_scale, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[15],&type_info[i].sql_data_type, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[16],&type_info[i].sql_datetime_sub, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[17],&type_info[i].num_prec_radix, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[18],&type_info[i].interval_precision, sizeof(SQLSMALLINT), 0,0,0,1);
|
||||
mdb_fill_temp_field(&fields[16],type_info[i].sql_datetime_sub, sizeof(SQLSMALLINT), 0,type_info[i].sql_datetime_sub ? 0 : 1,0,1);
|
||||
mdb_fill_temp_field(&fields[17],type_info[i].num_prec_radix, sizeof(SQLSMALLINT), 0,type_info[i].num_prec_radix ? 0 : 1,0,1);
|
||||
mdb_fill_temp_field(&fields[18],type_info[i].interval_precision, sizeof(SQLSMALLINT), 0,type_info[i].interval_precision ? 0 : 1,0,1);
|
||||
|
||||
row_size = mdb_pack_row(ttable, row_buffer, NUM_TYPE_INFO_COLS, fields);
|
||||
mdb_add_row_to_pg(ttable,row_buffer, row_size);
|
||||
@ -1522,6 +1523,8 @@ char quote_char;
|
||||
}
|
||||
*d='\0';
|
||||
strcpy(stmt->query,tmp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _odbc_get_string_size(int size, char *str)
|
||||
@ -1534,6 +1537,7 @@ static int _odbc_get_string_size(int size, char *str)
|
||||
} else {
|
||||
return size;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static int _odbc_get_server_type(int clt_type)
|
||||
{
|
||||
@ -1551,6 +1555,7 @@ static int _odbc_get_server_type(int clt_type)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static SQLSMALLINT _odbc_get_client_type(int srv_type)
|
||||
{
|
||||
@ -1580,5 +1585,6 @@ static SQLSMALLINT _odbc_get_client_type(int srv_type)
|
||||
// fprintf(stderr,"Unknown type %d\n",srv_type);
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ like { return LIKE; }
|
||||
[A-z][A-z0-9_#@]* { yylval.name = strdup(yytext); return NAME; }
|
||||
|
||||
'[A-z0-9 !@#$%^&*()-_+={}[\];:",.<>/?`~|\\]*' { yylval.name = strdup(yytext); return STRING; }
|
||||
(-*[0-9]+|([0-9]*\.[0-9+)([eE][-+]?[0-9]+)?) {
|
||||
(-*[0-9]+|([0-9]*\.[0-9]+)([eE][-+]?[0-9]+)?) {
|
||||
yylval.name = strdup(yytext); return NUMBER;
|
||||
}
|
||||
~?(\/?[A-z0-9\.]+)+ { yylval.name = strdup(yytext); return PATH; }
|
||||
|
@ -652,7 +652,7 @@ void mdb_sql_describe_table(MdbSQL *sql)
|
||||
|
||||
sprintf(tmpstr,"%d",col->col_size);
|
||||
tmpsiz = mdb_ascii2unicode(mdb, tmpstr, 0, 100, col_size);
|
||||
mdb_fill_temp_field(&fields[2],tmpstr, tmpsiz, 0,0,0,2);
|
||||
mdb_fill_temp_field(&fields[2],col_size, tmpsiz, 0,0,0,2);
|
||||
|
||||
row_size = mdb_pack_row(ttable, row_buffer, 3, fields);
|
||||
mdb_add_row_to_pg(ttable,row_buffer, row_size);
|
||||
|
Loading…
Reference in New Issue
Block a user