mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
DBF type N is now BIGINT when length is > 10.
Fix ha_connect::external_lock to use F_RDLCK, F_WRLCK, F_UNLCK.
This commit is contained in:
parent
e8c24a7374
commit
627d046df5
2 changed files with 9 additions and 17 deletions
|
|
@ -194,7 +194,7 @@ PQRYRES DBFColumns(PGLOBAL g, char *fn, BOOL info)
|
|||
static unsigned int length[] = {11, 6, 8, 10, 10, 6};
|
||||
char buf[2], filename[_MAX_PATH];
|
||||
int ncol = sizeof(dbtype) / sizeof(int);
|
||||
int rc, type, field, fields;
|
||||
int rc, type, len, field, fields;
|
||||
BOOL bad;
|
||||
DBFHEADER mainhead;
|
||||
DESCRIPTOR thisfield;
|
||||
|
|
@ -260,11 +260,12 @@ PQRYRES DBFColumns(PGLOBAL g, char *fn, BOOL info)
|
|||
if (fread(&thisfield, HEADLEN, 1, infile) != 1) {
|
||||
sprintf(g->Message, MSG(ERR_READING_REC), field+1, fn);
|
||||
goto err;
|
||||
} // endif fread
|
||||
} else
|
||||
len = thisfield.Length;
|
||||
|
||||
if (trace)
|
||||
htrc("%-11s %c %6ld %3d %2d %3d %3d\n",
|
||||
thisfield.Name, thisfield.Type, thisfield.Offset, thisfield.Length,
|
||||
thisfield.Name, thisfield.Type, thisfield.Offset, len,
|
||||
thisfield.Decimals, thisfield.Setfield, thisfield.Mdxfield);
|
||||
|
||||
/************************************************************************/
|
||||
|
|
@ -276,7 +277,8 @@ PQRYRES DBFColumns(PGLOBAL g, char *fn, BOOL info)
|
|||
type = TYPE_STRING;
|
||||
break;
|
||||
case 'N':
|
||||
type = (thisfield.Decimals) ? TYPE_FLOAT : TYPE_INT;
|
||||
type = (thisfield.Decimals) ? TYPE_FLOAT
|
||||
: (len > 10) ? TYPE_BIGINT : TYPE_INT;
|
||||
break;
|
||||
case 'F':
|
||||
type = TYPE_FLOAT;
|
||||
|
|
|
|||
|
|
@ -2785,16 +2785,6 @@ int ha_connect::delete_all_rows()
|
|||
DBUG_RETURN(rc);
|
||||
} // end of delete_all_rows
|
||||
|
||||
#if defined(WIN32)
|
||||
#define HA_LOCK_READ 1
|
||||
#define HA_LOCK_WRITE 2
|
||||
#define HA_LOCK_UNLOCK 3
|
||||
#else // !WIN32
|
||||
#define HA_LOCK_READ 0
|
||||
#define HA_LOCK_WRITE 1
|
||||
#define HA_LOCK_UNLOCK 2
|
||||
#endif // !WIN32
|
||||
|
||||
/**
|
||||
@brief
|
||||
This create a lock on the table. If you are implementing a storage engine
|
||||
|
|
@ -2833,13 +2823,13 @@ int ha_connect::external_lock(THD *thd, int lock_type)
|
|||
|
||||
// Action will depend on lock_type
|
||||
switch (lock_type) {
|
||||
case HA_LOCK_WRITE:
|
||||
case F_WRLCK:
|
||||
newmode= MODE_WRITE;
|
||||
break;
|
||||
case HA_LOCK_READ:
|
||||
case F_RDLCK:
|
||||
newmode= MODE_READ;
|
||||
break;
|
||||
case HA_LOCK_UNLOCK:
|
||||
case F_UNLCK:
|
||||
default:
|
||||
newmode= MODE_ANY;
|
||||
} // endswitch mode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue