mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- Fix variables used uninitialized
modified: storage/connect/filamdbf.cpp storage/connect/tabutil.cpp
This commit is contained in:
@@ -178,18 +178,18 @@ static int dbfhead(PGLOBAL g, FILE *file, PSZ fn, DBFHEADER *buf)
|
|||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
|
PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
|
||||||
{
|
{
|
||||||
static int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
|
int buftyp[] = {TYPE_STRING, TYPE_SHORT, TYPE_STRING,
|
||||||
TYPE_INT, TYPE_INT, TYPE_SHORT};
|
TYPE_INT, TYPE_INT, TYPE_SHORT};
|
||||||
static XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
|
XFLD fldtyp[] = {FLD_NAME, FLD_TYPE, FLD_TYPENAME,
|
||||||
FLD_PREC, FLD_LENGTH, FLD_SCALE};
|
FLD_PREC, FLD_LENGTH, FLD_SCALE};
|
||||||
static unsigned int length[] = {11, 6, 8, 10, 10, 6};
|
unsigned int length[] = {11, 6, 8, 10, 10, 6};
|
||||||
char buf[2], filename[_MAX_PATH];
|
char buf[2], filename[_MAX_PATH];
|
||||||
int ncol = sizeof(buftyp) / sizeof(int);
|
int ncol = sizeof(buftyp) / sizeof(int);
|
||||||
int rc, type, len, field, fields;
|
int rc, type, len, field, fields;
|
||||||
BOOL bad;
|
BOOL bad;
|
||||||
DBFHEADER mainhead;
|
DBFHEADER mainhead;
|
||||||
DESCRIPTOR thisfield;
|
DESCRIPTOR thisfield;
|
||||||
FILE *infile;
|
FILE *infile = NULL;
|
||||||
PQRYRES qrp;
|
PQRYRES qrp;
|
||||||
PCOLRES crp;
|
PCOLRES crp;
|
||||||
|
|
||||||
@@ -228,8 +228,12 @@ PQRYRES DBFColumns(PGLOBAL g, const char *fn, BOOL info)
|
|||||||
qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3,
|
qrp = PlgAllocResult(g, ncol, fields, IDS_COLUMNS + 3,
|
||||||
buftyp, fldtyp, length, true, false);
|
buftyp, fldtyp, length, true, false);
|
||||||
|
|
||||||
if (info || !qrp)
|
if (info || !qrp) {
|
||||||
|
if (infile)
|
||||||
|
fclose(infile);
|
||||||
|
|
||||||
return qrp;
|
return qrp;
|
||||||
|
} // endif info
|
||||||
|
|
||||||
if (trace) {
|
if (trace) {
|
||||||
htrc("Structure of %s\n", filename);
|
htrc("Structure of %s\n", filename);
|
||||||
|
@@ -218,7 +218,8 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
|
|||||||
if (type == TYPE_DECIM)
|
if (type == TYPE_DECIM)
|
||||||
prec = ((Field_new_decimal*)fp)->precision;
|
prec = ((Field_new_decimal*)fp)->precision;
|
||||||
else
|
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();
|
len = fp->char_length();
|
||||||
fmt = NULL;
|
fmt = NULL;
|
||||||
|
Reference in New Issue
Block a user