Commit 19e9fa45 authored by Olivier Bertrand's avatar Olivier Bertrand

- Use all columns in case of INSERT so default values are generated for

  columns not specified in the statemant.

modified:
  storage/connect/ha_connect.cc
parent f81c60a4
...@@ -1322,11 +1322,12 @@ bool ha_connect::OpenTable(PGLOBAL g, bool del) ...@@ -1322,11 +1322,12 @@ bool ha_connect::OpenTable(PGLOBAL g, bool del)
break; break;
} // endswitch xmode } // endswitch xmode
if (xmod != MODE_INSERT) {
// Get the list of used fields (columns) // Get the list of used fields (columns)
char *p; char *p;
unsigned int k1, k2, n1, n2; unsigned int k1, k2, n1, n2;
Field* *field; Field* *field;
MY_BITMAP *map= (xmod != MODE_INSERT) ? table->read_set : table->write_set; MY_BITMAP *map= table->read_set;
MY_BITMAP *ump= (xmod == MODE_UPDATE) ? table->write_set : NULL; MY_BITMAP *ump= (xmod == MODE_UPDATE) ? table->write_set : NULL;
k1= k2= 0; k1= k2= 0;
...@@ -1369,6 +1370,8 @@ bool ha_connect::OpenTable(PGLOBAL g, bool del) ...@@ -1369,6 +1370,8 @@ bool ha_connect::OpenTable(PGLOBAL g, bool del)
*p= '\0'; // mark end of list *p= '\0'; // mark end of list
} // endif k2 } // endif k2
} // endif xmod
// Open the table // Open the table
if (!(rc= CntOpenTable(g, tdbp, xmod, c1, c2, del, this))) { if (!(rc= CntOpenTable(g, tdbp, xmod, c1, c2, del, this))) {
istable= true; istable= true;
...@@ -1571,7 +1574,8 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf) ...@@ -1571,7 +1574,8 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
continue; // Is a virtual column possible here ??? continue; // Is a virtual column possible here ???
#endif // MARIADB #endif // MARIADB
if (bitmap_is_set(table->write_set, fp->field_index)) { if (xmod == MODE_INSERT ||
bitmap_is_set(table->write_set, fp->field_index)) {
for (colp= tp->GetSetCols(); colp; colp= colp->GetNext()) for (colp= tp->GetSetCols(); colp; colp= colp->GetNext())
if (!stricmp(colp->GetName(), fp->field_name)) if (!stricmp(colp->GetName(), fp->field_name))
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment