|
|
@ -1947,7 +1947,7 @@ int ha_connect::OpenTable(PGLOBAL g, bool del) |
|
|
|
k1= k2= 0; |
|
|
|
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)) { |
|
|
|
n1+= (fp->field_name.length + 1); |
|
|
|
k1++; |
|
|
@ -1963,7 +1963,7 @@ int ha_connect::OpenTable(PGLOBAL g, bool del) |
|
|
|
if (k1) { |
|
|
|
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)) { |
|
|
|
strcpy(p, fp->field_name.str); |
|
|
|
p+= (fp->field_name.length + 1); |
|
|
@ -1975,7 +1975,7 @@ int ha_connect::OpenTable(PGLOBAL g, bool del) |
|
|
|
if (k2) { |
|
|
|
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)) { |
|
|
|
strcpy(p, fp->field_name.str); |
|
|
|
|
|
|
@ -2002,11 +2002,13 @@ int ha_connect::OpenTable(PGLOBAL g, bool del) |
|
|
|
istable= true; |
|
|
|
// strmake(tname, table_name, sizeof(tname)-1);
|
|
|
|
|
|
|
|
#ifdef NOT_USED_VARIABLE
|
|
|
|
// We may be in a create index query
|
|
|
|
if (xmod == MODE_ANY && *tdbp->GetName() != '#') { |
|
|
|
// The current indexes
|
|
|
|
PIXDEF oldpix= GetIndexInfo(); |
|
|
|
} // endif xmod
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} else |
|
|
|
htrc("OpenTable: %s\n", g->Message); |
|
|
@ -2033,7 +2035,7 @@ bool ha_connect::CheckColumnList(PGLOBAL g) |
|
|
|
MY_BITMAP *map= table->read_set; |
|
|
|
|
|
|
|
try { |
|
|
|
for (field= table->field; fp= *field; field++) |
|
|
|
for (field= table->field; (fp= *field); field++) |
|
|
|
if (bitmap_is_set(map, fp->field_index)) { |
|
|
|
if (!(colp= tdbp->ColDB(g, (PSZ)fp->field_name.str, 0))) { |
|
|
|
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, "'}"); |
|
|
|
break; |
|
|
|
} // endif ODBC
|
|
|
|
|
|
|
|
// fall through
|
|
|
|
// fall through
|
|
|
|
case MYSQL_TYPE_DATE: |
|
|
|
if (tty == TYPE_AM_ODBC) { |
|
|
|
strcat(s, "{d '"); |
|
|
|
strcat(strncat(s, res->ptr(), res->length()), "'}"); |
|
|
|
break; |
|
|
|
} // endif ODBC
|
|
|
|
// fall through
|
|
|
|
|
|
|
|
case MYSQL_TYPE_TIME: |
|
|
|
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()), "'}"); |
|
|
|
break; |
|
|
|
} // endif ODBC
|
|
|
|
// fall through
|
|
|
|
|
|
|
|
case MYSQL_TYPE_VARCHAR: |
|
|
|
if (tty == TYPE_AM_ODBC && i) { |
|
|
@ -4272,8 +4275,6 @@ int ha_connect::info(uint flag) |
|
|
|
|
|
|
|
// tdbp must be available to get updated info
|
|
|
|
if (xp->CheckQuery(valid_query_id) || !tdbp) { |
|
|
|
PDBUSER dup= PlgGetUser(g); |
|
|
|
PCATLG cat= (dup) ? dup->Catalog : NULL; |
|
|
|
|
|
|
|
if (xmod == MODE_ANY || xmod == MODE_ALTER) { |
|
|
|
// Pure info, not a query
|
|
|
@ -4576,12 +4577,14 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd, |
|
|
|
// break;
|
|
|
|
case SQLCOM_DELETE_MULTI: |
|
|
|
*cras = true; |
|
|
|
// fall through
|
|
|
|
case SQLCOM_DELETE: |
|
|
|
case SQLCOM_TRUNCATE: |
|
|
|
newmode= MODE_DELETE; |
|
|
|
break; |
|
|
|
case SQLCOM_UPDATE_MULTI: |
|
|
|
*cras = true; |
|
|
|
// fall through
|
|
|
|
case SQLCOM_UPDATE: |
|
|
|
newmode= MODE_UPDATE; |
|
|
|
break; |
|
|
@ -4591,6 +4594,7 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd, |
|
|
|
break; |
|
|
|
case SQLCOM_FLUSH: |
|
|
|
locked= 0; |
|
|
|
// fall through
|
|
|
|
case SQLCOM_DROP_TABLE: |
|
|
|
case SQLCOM_RENAME_TABLE: |
|
|
|
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 rc= 0; |
|
|
|
bool chk=false, cras= false; |
|
|
|
MODE newmode; |
|
|
|
PGLOBAL g= GetPlug(thd, xp); |
|
|
@ -5516,7 +5519,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, |
|
|
|
PCSZ nsp= NULL, cls= NULL; |
|
|
|
#endif // __WIN__
|
|
|
|
//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;
|
|
|
|
#if defined(ODBC_SUPPORT)
|
|
|
|
POPARM sop= NULL; |
|
|
@ -5540,8 +5543,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd, |
|
|
|
if (!g) |
|
|
|
return HA_ERR_INTERNAL_ERROR; |
|
|
|
|
|
|
|
PDBUSER dup= PlgGetUser(g); |
|
|
|
PCATLG cat= (dup) ? dup->Catalog : NULL; |
|
|
|
PTOS topt= table_s->option_struct; |
|
|
|
char buf[1024]; |
|
|
|
String sql(buf, sizeof(buf), system_charset_info); |
|
|
@ -5771,6 +5772,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, |
|
|
|
#endif // __WIN__
|
|
|
|
case TAB_PIVOT: |
|
|
|
supfnc = FNC_NO; |
|
|
|
// fall through
|
|
|
|
case TAB_PRX: |
|
|
|
case TAB_TBL: |
|
|
|
case TAB_XCL: |
|
|
@ -5995,7 +5997,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, |
|
|
|
} // endfor crp
|
|
|
|
|
|
|
|
} else { |
|
|
|
char *schem = NULL; |
|
|
|
char *schem __attribute__((unused)) = NULL; |
|
|
|
char *tn = NULL; |
|
|
|
|
|
|
|
// Not a catalog table
|
|
|
|