mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
- Fix wrong error "Invalid offset for CVS table" when a special
column is defined in a CSV table (MDEV-6187) modified: storage/connect/ha_connect.cc storage/connect/reldef.h storage/connect/tabfmt.cpp
This commit is contained in:
@@ -2708,7 +2708,6 @@ int ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen)
|
|||||||
*/
|
*/
|
||||||
int ha_connect::rnd_init(bool scan)
|
int ha_connect::rnd_init(bool scan)
|
||||||
{
|
{
|
||||||
int rc;
|
|
||||||
PGLOBAL g= ((table && table->in_use) ? GetPlug(table->in_use, xp) :
|
PGLOBAL g= ((table && table->in_use) ? GetPlug(table->in_use, xp) :
|
||||||
(xp) ? xp->g : NULL);
|
(xp) ? xp->g : NULL);
|
||||||
DBUG_ENTER("ha_connect::rnd_init");
|
DBUG_ENTER("ha_connect::rnd_init");
|
||||||
@@ -2742,8 +2741,8 @@ int ha_connect::rnd_init(bool scan)
|
|||||||
if (xmod == MODE_UPDATE)
|
if (xmod == MODE_UPDATE)
|
||||||
bitmap_union(table->read_set, table->write_set);
|
bitmap_union(table->read_set, table->write_set);
|
||||||
|
|
||||||
if ((rc= OpenTable(g, xmod == MODE_DELETE)))
|
if (OpenTable(g, xmod == MODE_DELETE))
|
||||||
DBUG_RETURN(rc);
|
DBUG_RETURN(HA_ERR_INITIALIZATION);
|
||||||
|
|
||||||
xp->nrd= xp->fnd= xp->nfd= 0;
|
xp->nrd= xp->fnd= xp->nfd= 0;
|
||||||
xp->tb1= my_interval_timer();
|
xp->tb1= my_interval_timer();
|
||||||
|
@@ -195,6 +195,7 @@ class DllExport COLDEF : public COLCRT { /* Column description block
|
|||||||
int GetPoff(void) {return Poff;}
|
int GetPoff(void) {return Poff;}
|
||||||
int Define(PGLOBAL g, void *memp, PCOLINFO cfp, int poff);
|
int Define(PGLOBAL g, void *memp, PCOLINFO cfp, int poff);
|
||||||
void Define(PGLOBAL g, PCOL colp);
|
void Define(PGLOBAL g, PCOL colp);
|
||||||
|
bool IsSpecial(void) {return (Flags & U_SPECIAL) ? true : false;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int Buf_Type; /* Internal data type */
|
int Buf_Type; /* Internal data type */
|
||||||
|
@@ -406,7 +406,7 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
|
|||||||
// Double check correctness of offset values
|
// Double check correctness of offset values
|
||||||
if (Catfunc == FNC_NO)
|
if (Catfunc == FNC_NO)
|
||||||
for (PCOLDEF cdp = To_Cols; cdp; cdp = cdp->GetNext())
|
for (PCOLDEF cdp = To_Cols; cdp; cdp = cdp->GetNext())
|
||||||
if (cdp->GetOffset() < 1) {
|
if (cdp->GetOffset() < 1 && !cdp->IsSpecial()) {
|
||||||
strcpy(g->Message, MSG(BAD_OFFSET_VAL));
|
strcpy(g->Message, MSG(BAD_OFFSET_VAL));
|
||||||
return true;
|
return true;
|
||||||
} // endif Offset
|
} // endif Offset
|
||||||
|
Reference in New Issue
Block a user