summaryrefslogtreecommitdiff
path: root/storage/connect
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-05-09 12:35:19 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-05-09 12:35:19 +0200
commit7bbcc3e4ed6eef226b6978615cd64294b6bfe95c (patch)
treec3d3728f2ff769355f19f34c9ec0c7f608a41a42 /storage/connect
parent3743e1e0f626833d6941a8b04d90f7c836d12dcf (diff)
downloadmariadb-git-7bbcc3e4ed6eef226b6978615cd64294b6bfe95c.tar.gz
- 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
Diffstat (limited to 'storage/connect')
-rw-r--r--storage/connect/ha_connect.cc5
-rw-r--r--storage/connect/reldef.h1
-rw-r--r--storage/connect/tabfmt.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 974906d6ed5..9425e3a2727 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -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 rc;
PGLOBAL g= ((table && table->in_use) ? GetPlug(table->in_use, xp) :
(xp) ? xp->g : NULL);
DBUG_ENTER("ha_connect::rnd_init");
@@ -2742,8 +2741,8 @@ int ha_connect::rnd_init(bool scan)
if (xmod == MODE_UPDATE)
bitmap_union(table->read_set, table->write_set);
- if ((rc= OpenTable(g, xmod == MODE_DELETE)))
- DBUG_RETURN(rc);
+ if (OpenTable(g, xmod == MODE_DELETE))
+ DBUG_RETURN(HA_ERR_INITIALIZATION);
xp->nrd= xp->fnd= xp->nfd= 0;
xp->tb1= my_interval_timer();
diff --git a/storage/connect/reldef.h b/storage/connect/reldef.h
index 6f6853d9f17..eb559864a34 100644
--- a/storage/connect/reldef.h
+++ b/storage/connect/reldef.h
@@ -195,6 +195,7 @@ class DllExport COLDEF : public COLCRT { /* Column description block
int GetPoff(void) {return Poff;}
int Define(PGLOBAL g, void *memp, PCOLINFO cfp, int poff);
void Define(PGLOBAL g, PCOL colp);
+ bool IsSpecial(void) {return (Flags & U_SPECIAL) ? true : false;}
protected:
int Buf_Type; /* Internal data type */
diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp
index b15d5c201c9..80bdee05b73 100644
--- a/storage/connect/tabfmt.cpp
+++ b/storage/connect/tabfmt.cpp
@@ -406,7 +406,7 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
// Double check correctness of offset values
if (Catfunc == FNC_NO)
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));
return true;
} // endif Offset