mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixed compiler warnings form gcc 7.3.1
This commit is contained in:
@@ -5142,7 +5142,7 @@ xb_process_datadir(
|
|||||||
handle_datadir_entry_func_t func) /*!<in: callback */
|
handle_datadir_entry_func_t func) /*!<in: callback */
|
||||||
{
|
{
|
||||||
ulint ret;
|
ulint ret;
|
||||||
char dbpath[OS_FILE_MAX_PATH+1];
|
char dbpath[OS_FILE_MAX_PATH+2];
|
||||||
os_file_dir_t dir;
|
os_file_dir_t dir;
|
||||||
os_file_dir_t dbdir;
|
os_file_dir_t dbdir;
|
||||||
os_file_stat_t dbinfo;
|
os_file_stat_t dbinfo;
|
||||||
|
@@ -464,6 +464,7 @@ inline bool is_temporal_type_with_date(enum_field_types type)
|
|||||||
case MYSQL_TYPE_DATETIME2:
|
case MYSQL_TYPE_DATETIME2:
|
||||||
case MYSQL_TYPE_TIMESTAMP2:
|
case MYSQL_TYPE_TIMESTAMP2:
|
||||||
DBUG_ASSERT(0); // field->real_type() should not get to here.
|
DBUG_ASSERT(0); // field->real_type() should not get to here.
|
||||||
|
return false;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -618,10 +618,12 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp)
|
|||||||
/* Converting STRING to DATE can be done according to date format. */
|
/* Converting STRING to DATE can be done according to date format. */
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
if (Type == TYPE_DATE && ovblp->GetType() == TYPE_STRING && vp)
|
if (Type == TYPE_DATE && ovblp->GetType() == TYPE_STRING && vp)
|
||||||
|
{
|
||||||
if (((DTVAL*)Value)->SetFormat(g, vp))
|
if (((DTVAL*)Value)->SetFormat(g, vp))
|
||||||
return TYPE_ERROR;
|
return TYPE_ERROR;
|
||||||
else
|
else
|
||||||
b = true; // Sort the new array on date internal values
|
b = true; // Sort the new array on date internal values
|
||||||
|
}
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
/* Do the actual conversion. */
|
/* Do the actual conversion. */
|
||||||
|
@@ -1947,7 +1947,7 @@ int ha_connect::OpenTable(PGLOBAL g, bool del)
|
|||||||
k1= k2= 0;
|
k1= k2= 0;
|
||||||
n1= n2= 1; // 1 is space for final null character
|
n1= n2= 1; // 1 is space for final null character
|
||||||
|
|
||||||
for (field= table->field; fp= *field; field++) {
|
for (field= table->field; (fp= *field); field++) {
|
||||||
if (bitmap_is_set(map, fp->field_index)) {
|
if (bitmap_is_set(map, fp->field_index)) {
|
||||||
n1+= (fp->field_name.length + 1);
|
n1+= (fp->field_name.length + 1);
|
||||||
k1++;
|
k1++;
|
||||||
@@ -1963,7 +1963,7 @@ int ha_connect::OpenTable(PGLOBAL g, bool del)
|
|||||||
if (k1) {
|
if (k1) {
|
||||||
p= c1= (char*)PlugSubAlloc(g, NULL, n1);
|
p= c1= (char*)PlugSubAlloc(g, NULL, n1);
|
||||||
|
|
||||||
for (field= table->field; fp= *field; field++)
|
for (field= table->field; (fp= *field); field++)
|
||||||
if (bitmap_is_set(map, fp->field_index)) {
|
if (bitmap_is_set(map, fp->field_index)) {
|
||||||
strcpy(p, fp->field_name.str);
|
strcpy(p, fp->field_name.str);
|
||||||
p+= (fp->field_name.length + 1);
|
p+= (fp->field_name.length + 1);
|
||||||
@@ -1975,7 +1975,7 @@ int ha_connect::OpenTable(PGLOBAL g, bool del)
|
|||||||
if (k2) {
|
if (k2) {
|
||||||
p= c2= (char*)PlugSubAlloc(g, NULL, n2);
|
p= c2= (char*)PlugSubAlloc(g, NULL, n2);
|
||||||
|
|
||||||
for (field= table->field; fp= *field; field++)
|
for (field= table->field; (fp= *field); field++)
|
||||||
if (bitmap_is_set(ump, fp->field_index)) {
|
if (bitmap_is_set(ump, fp->field_index)) {
|
||||||
strcpy(p, fp->field_name.str);
|
strcpy(p, fp->field_name.str);
|
||||||
|
|
||||||
@@ -2002,11 +2002,13 @@ int ha_connect::OpenTable(PGLOBAL g, bool del)
|
|||||||
istable= true;
|
istable= true;
|
||||||
// strmake(tname, table_name, sizeof(tname)-1);
|
// strmake(tname, table_name, sizeof(tname)-1);
|
||||||
|
|
||||||
|
#ifdef NOT_USED_VARIABLE
|
||||||
// We may be in a create index query
|
// We may be in a create index query
|
||||||
if (xmod == MODE_ANY && *tdbp->GetName() != '#') {
|
if (xmod == MODE_ANY && *tdbp->GetName() != '#') {
|
||||||
// The current indexes
|
// The current indexes
|
||||||
PIXDEF oldpix= GetIndexInfo();
|
PIXDEF oldpix= GetIndexInfo();
|
||||||
} // endif xmod
|
} // endif xmod
|
||||||
|
#endif
|
||||||
|
|
||||||
} else
|
} else
|
||||||
htrc("OpenTable: %s\n", g->Message);
|
htrc("OpenTable: %s\n", g->Message);
|
||||||
@@ -2033,7 +2035,7 @@ bool ha_connect::CheckColumnList(PGLOBAL g)
|
|||||||
MY_BITMAP *map= table->read_set;
|
MY_BITMAP *map= table->read_set;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for (field= table->field; fp= *field; field++)
|
for (field= table->field; (fp= *field); field++)
|
||||||
if (bitmap_is_set(map, fp->field_index)) {
|
if (bitmap_is_set(map, fp->field_index)) {
|
||||||
if (!(colp= tdbp->ColDB(g, (PSZ)fp->field_name.str, 0))) {
|
if (!(colp= tdbp->ColDB(g, (PSZ)fp->field_name.str, 0))) {
|
||||||
sprintf(g->Message, "Column %s not found in %s",
|
sprintf(g->Message, "Column %s not found in %s",
|
||||||
@@ -3069,14 +3071,14 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
|
|||||||
strcat(s, "'}");
|
strcat(s, "'}");
|
||||||
break;
|
break;
|
||||||
} // endif ODBC
|
} // endif ODBC
|
||||||
|
// fall through
|
||||||
// fall through
|
|
||||||
case MYSQL_TYPE_DATE:
|
case MYSQL_TYPE_DATE:
|
||||||
if (tty == TYPE_AM_ODBC) {
|
if (tty == TYPE_AM_ODBC) {
|
||||||
strcat(s, "{d '");
|
strcat(s, "{d '");
|
||||||
strcat(strncat(s, res->ptr(), res->length()), "'}");
|
strcat(strncat(s, res->ptr(), res->length()), "'}");
|
||||||
break;
|
break;
|
||||||
} // endif ODBC
|
} // endif ODBC
|
||||||
|
// fall through
|
||||||
|
|
||||||
case MYSQL_TYPE_TIME:
|
case MYSQL_TYPE_TIME:
|
||||||
if (tty == TYPE_AM_ODBC) {
|
if (tty == TYPE_AM_ODBC) {
|
||||||
@@ -3084,6 +3086,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
|
|||||||
strcat(strncat(s, res->ptr(), res->length()), "'}");
|
strcat(strncat(s, res->ptr(), res->length()), "'}");
|
||||||
break;
|
break;
|
||||||
} // endif ODBC
|
} // endif ODBC
|
||||||
|
// fall through
|
||||||
|
|
||||||
case MYSQL_TYPE_VARCHAR:
|
case MYSQL_TYPE_VARCHAR:
|
||||||
if (tty == TYPE_AM_ODBC && i) {
|
if (tty == TYPE_AM_ODBC && i) {
|
||||||
@@ -4272,8 +4275,6 @@ int ha_connect::info(uint flag)
|
|||||||
|
|
||||||
// tdbp must be available to get updated info
|
// tdbp must be available to get updated info
|
||||||
if (xp->CheckQuery(valid_query_id) || !tdbp) {
|
if (xp->CheckQuery(valid_query_id) || !tdbp) {
|
||||||
PDBUSER dup= PlgGetUser(g);
|
|
||||||
PCATLG cat= (dup) ? dup->Catalog : NULL;
|
|
||||||
|
|
||||||
if (xmod == MODE_ANY || xmod == MODE_ALTER) {
|
if (xmod == MODE_ANY || xmod == MODE_ALTER) {
|
||||||
// Pure info, not a query
|
// Pure info, not a query
|
||||||
@@ -4576,12 +4577,14 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd,
|
|||||||
// break;
|
// break;
|
||||||
case SQLCOM_DELETE_MULTI:
|
case SQLCOM_DELETE_MULTI:
|
||||||
*cras = true;
|
*cras = true;
|
||||||
|
// fall through
|
||||||
case SQLCOM_DELETE:
|
case SQLCOM_DELETE:
|
||||||
case SQLCOM_TRUNCATE:
|
case SQLCOM_TRUNCATE:
|
||||||
newmode= MODE_DELETE;
|
newmode= MODE_DELETE;
|
||||||
break;
|
break;
|
||||||
case SQLCOM_UPDATE_MULTI:
|
case SQLCOM_UPDATE_MULTI:
|
||||||
*cras = true;
|
*cras = true;
|
||||||
|
// fall through
|
||||||
case SQLCOM_UPDATE:
|
case SQLCOM_UPDATE:
|
||||||
newmode= MODE_UPDATE;
|
newmode= MODE_UPDATE;
|
||||||
break;
|
break;
|
||||||
@@ -4591,6 +4594,7 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd,
|
|||||||
break;
|
break;
|
||||||
case SQLCOM_FLUSH:
|
case SQLCOM_FLUSH:
|
||||||
locked= 0;
|
locked= 0;
|
||||||
|
// fall through
|
||||||
case SQLCOM_DROP_TABLE:
|
case SQLCOM_DROP_TABLE:
|
||||||
case SQLCOM_RENAME_TABLE:
|
case SQLCOM_RENAME_TABLE:
|
||||||
newmode= MODE_ANY;
|
newmode= MODE_ANY;
|
||||||
@@ -4687,7 +4691,6 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd,
|
|||||||
|
|
||||||
int ha_connect::start_stmt(THD *thd, thr_lock_type lock_type)
|
int ha_connect::start_stmt(THD *thd, thr_lock_type lock_type)
|
||||||
{
|
{
|
||||||
int rc= 0;
|
|
||||||
bool chk=false, cras= false;
|
bool chk=false, cras= false;
|
||||||
MODE newmode;
|
MODE newmode;
|
||||||
PGLOBAL g= GetPlug(thd, xp);
|
PGLOBAL g= GetPlug(thd, xp);
|
||||||
@@ -5516,7 +5519,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
PCSZ nsp= NULL, cls= NULL;
|
PCSZ nsp= NULL, cls= NULL;
|
||||||
#endif // __WIN__
|
#endif // __WIN__
|
||||||
//int hdr, mxe;
|
//int hdr, mxe;
|
||||||
int port = 0, mxr = 0, rc = 0, mul = 0, lrecl = 0;
|
int port = 0, mxr __attribute__((unused)) = 0, rc = 0, mul = 0;
|
||||||
//PCSZ tabtyp = NULL;
|
//PCSZ tabtyp = NULL;
|
||||||
#if defined(ODBC_SUPPORT)
|
#if defined(ODBC_SUPPORT)
|
||||||
POPARM sop= NULL;
|
POPARM sop= NULL;
|
||||||
@@ -5540,8 +5543,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
if (!g)
|
if (!g)
|
||||||
return HA_ERR_INTERNAL_ERROR;
|
return HA_ERR_INTERNAL_ERROR;
|
||||||
|
|
||||||
PDBUSER dup= PlgGetUser(g);
|
|
||||||
PCATLG cat= (dup) ? dup->Catalog : NULL;
|
|
||||||
PTOS topt= table_s->option_struct;
|
PTOS topt= table_s->option_struct;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
String sql(buf, sizeof(buf), system_charset_info);
|
String sql(buf, sizeof(buf), system_charset_info);
|
||||||
@@ -5771,6 +5772,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
#endif // __WIN__
|
#endif // __WIN__
|
||||||
case TAB_PIVOT:
|
case TAB_PIVOT:
|
||||||
supfnc = FNC_NO;
|
supfnc = FNC_NO;
|
||||||
|
// fall through
|
||||||
case TAB_PRX:
|
case TAB_PRX:
|
||||||
case TAB_TBL:
|
case TAB_TBL:
|
||||||
case TAB_XCL:
|
case TAB_XCL:
|
||||||
@@ -5995,7 +5997,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
} // endfor crp
|
} // endfor crp
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
char *schem = NULL;
|
char *schem __attribute__((unused)) = NULL;
|
||||||
char *tn = NULL;
|
char *tn = NULL;
|
||||||
|
|
||||||
// Not a catalog table
|
// Not a catalog table
|
||||||
|
@@ -342,7 +342,6 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
|
|||||||
char *catp = NULL, buf[NAM_LEN * 3];
|
char *catp = NULL, buf[NAM_LEN * 3];
|
||||||
int len;
|
int len;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
PTABLE tablep = To_Table;
|
|
||||||
PCOL colp;
|
PCOL colp;
|
||||||
|
|
||||||
if (Srcdef)
|
if (Srcdef)
|
||||||
@@ -455,6 +454,7 @@ void TDBEXT::RemoveConst(PGLOBAL g, char *stmt)
|
|||||||
int n, nc;
|
int n, nc;
|
||||||
|
|
||||||
while ((p = strstr(stmt, "NAME_CONST")))
|
while ((p = strstr(stmt, "NAME_CONST")))
|
||||||
|
{
|
||||||
if ((n = sscanf(p, "%*[^,],%1024[^)])%n", val, &nc))) {
|
if ((n = sscanf(p, "%*[^,],%1024[^)])%n", val, &nc))) {
|
||||||
if (trace(33))
|
if (trace(33))
|
||||||
htrc("p=%s\nn=%d val=%s nc=%d\n", p, n, val, nc);
|
htrc("p=%s\nn=%d val=%s nc=%d\n", p, n, val, nc);
|
||||||
@@ -478,8 +478,8 @@ void TDBEXT::RemoveConst(PGLOBAL g, char *stmt)
|
|||||||
|
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} // end of RemoveConst
|
} // end of RemoveConst
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
@@ -1259,7 +1259,7 @@ MYSQLCOL::MYSQLCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
|
|||||||
MYSQLCOL::MYSQLCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PCSZ am)
|
MYSQLCOL::MYSQLCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PCSZ am)
|
||||||
: COLBLK(NULL, tdbp, i)
|
: COLBLK(NULL, tdbp, i)
|
||||||
{
|
{
|
||||||
const char *chset = get_charset_name(fld->charsetnr);
|
//const char *chset = get_charset_name(fld->charsetnr);
|
||||||
//char v = (!strcmp(chset, "binary")) ? 'B' : 0;
|
//char v = (!strcmp(chset, "binary")) ? 'B' : 0;
|
||||||
char v = 0;
|
char v = 0;
|
||||||
|
|
||||||
@@ -1400,6 +1400,7 @@ void MYSQLCOL::ReadColumn(PGLOBAL g)
|
|||||||
/* If physical fetching of the line was deferred, do it now. */
|
/* If physical fetching of the line was deferred, do it now. */
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
if (!tdbp->Fetched)
|
if (!tdbp->Fetched)
|
||||||
|
{
|
||||||
if ((rc = tdbp->Myc.Fetch(g, tdbp->N)) != RC_OK) {
|
if ((rc = tdbp->Myc.Fetch(g, tdbp->N)) != RC_OK) {
|
||||||
if (rc == RC_EF)
|
if (rc == RC_EF)
|
||||||
sprintf(g->Message, MSG(INV_DEF_READ), rc);
|
sprintf(g->Message, MSG(INV_DEF_READ), rc);
|
||||||
@@ -1407,7 +1408,7 @@ void MYSQLCOL::ReadColumn(PGLOBAL g)
|
|||||||
throw 11;
|
throw 11;
|
||||||
} else
|
} else
|
||||||
tdbp->Fetched = true;
|
tdbp->Fetched = true;
|
||||||
|
}
|
||||||
if ((buf = ((PTDBMY)To_Tdb)->Myc.GetCharField(Rank))) {
|
if ((buf = ((PTDBMY)To_Tdb)->Myc.GetCharField(Rank))) {
|
||||||
if (trace(2))
|
if (trace(2))
|
||||||
htrc("MySQL ReadColumn: name=%s buf=%s\n", Name, buf);
|
htrc("MySQL ReadColumn: name=%s buf=%s\n", Name, buf);
|
||||||
|
@@ -274,7 +274,8 @@ void XCLCOL::ReadColumn(PGLOBAL g)
|
|||||||
PSZ p;
|
PSZ p;
|
||||||
|
|
||||||
// Trim left
|
// Trim left
|
||||||
for (p = Cp; *p == ' '; p++) ;
|
for (p = Cp; *p == ' '; p++)
|
||||||
|
;
|
||||||
|
|
||||||
if ((Cp = strchr(Cp, Sep)))
|
if ((Cp = strchr(Cp, Sep)))
|
||||||
// Separator is found
|
// Separator is found
|
||||||
|
@@ -2599,12 +2599,13 @@ bool DTVAL::MakeDate(PGLOBAL g, int *val, int nval)
|
|||||||
|
|
||||||
// Pass g to have an error return or NULL to set invalid dates to 0
|
// Pass g to have an error return or NULL to set invalid dates to 0
|
||||||
if (MakeTime(&datm))
|
if (MakeTime(&datm))
|
||||||
|
{
|
||||||
if (g) {
|
if (g) {
|
||||||
strcpy(g->Message, MSG(BAD_DATETIME));
|
strcpy(g->Message, MSG(BAD_DATETIME));
|
||||||
rc = true;
|
rc = true;
|
||||||
} else
|
} else
|
||||||
Tval = 0;
|
Tval = 0;
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
} // end of MakeDate
|
} // end of MakeDate
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user