mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
- Fix variables used uninitialized
modified: storage/connect/filamdbf.cpp storage/connect/tabutil.cpp
This commit is contained in:
parent
c055e5e0ef
commit
32284eba5c
2 changed files with 13 additions and 8 deletions
|
|
@ -178,18 +178,18 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
|
|||
/****************************************************************************/
|
||||
PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
|
||||
{
|
||||
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
|
||||
TYPE_INT, TYPE_INT, TYPE_SHORT};
|
||||
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
|
||||
FLD_PREC, FLD_LENGTH, FLD_SCALE};
|
||||
static unsigned int length[] = {11, 6, 8, 10, 10, 6};
|
||||
int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
|
||||
TYPE_INT, TYPE_INT, TYPE_SHORT};
|
||||
XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
|
||||
FLD_PREC, FLD_LENGTH, FLD_SCALE};
|
||||
unsigned int length[] = {11, 6, 8, 10, 10, 6};
|
||||
char buf[2], filename[_MAX_PATH];
|
||||
int ncol = sizeof(buftyp) / sizeof(int);
|
||||
int rc, type, len, field, fields;
|
||||
BOOL bad;
|
||||
DBFHEADER mainhead;
|
||||
DESCRIPTOR thisfield;
|
||||
FILE *infile;
|
||||
FILE *infile = NULL;
|
||||
PQRYRES qrp;
|
||||
PCOLRES crp;
|
||||
|
||||
|
|
@ -228,8 +228,12 @@ PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
|
|||
qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3,
|
||||
buftyp, fldtyp, length, true, false);
|
||||
|
||||
if (info || !qrp)
|
||||
if (info || !qrp) {
|
||||
if (infile)
|
||||
fclose(infile);
|
||||
|
||||
return qrp;
|
||||
} // endif info
|
||||
|
||||
if (trace) {
|
||||
htrc("Structure of %s\n", filename);
|
||||
|
|
|
|||
|
|
@ -218,7 +218,8 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
|
|||
if (type == TYPE_DECIM)
|
||||
prec = ((Field_new_decimal*)fp)->precision;
|
||||
else
|
||||
prec = (prec == NOT_FIXED_DEC) ? 0 : fp->field_length;
|
||||
prec = fp->field_length;
|
||||
// prec = (prec(???) == NOT_FIXED_DEC) ? 0 : fp->field_length;
|
||||
|
||||
len = fp->char_length();
|
||||
fmt = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue