1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Catalog table: Use XFLD as Flag value instead of column index.

- Use the COLDEF flag to initialize column nullable value.
- Fix a bug on inserting null values in MYSQL tables.

modified:
  storage/connect/colblk.cpp
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/odbconn.cpp
  storage/connect/plgdbsem.h
  storage/connect/table.cpp
  storage/connect/tabmysql.cpp
This commit is contained in:
Olivier Bertrand
2013-02-25 22:44:42 +01:00
parent 2b60525d57
commit edd161587e
7 changed files with 36 additions and 29 deletions

View File

@@ -846,15 +846,19 @@ int TDBMYSQL::WriteDB(PGLOBAL g)
// Make the Insert command value list
for (PCOL colp = Columns; colp; colp = colp->GetNext()) {
if (colp->GetResultType() == TYPE_STRING ||
colp->GetResultType() == TYPE_DATE)
strcat(Qbuf, "'");
if (!colp->GetValue()->IsNull()) {
if (colp->GetResultType() == TYPE_STRING ||
colp->GetResultType() == TYPE_DATE)
strcat(Qbuf, "'");
strcat(Qbuf, colp->GetValue()->GetCharString(buf));
strcat(Qbuf, colp->GetValue()->GetCharString(buf));
if (colp->GetResultType() == TYPE_STRING ||
colp->GetResultType() == TYPE_DATE)
strcat(Qbuf, "'");
if (colp->GetResultType() == TYPE_STRING ||
colp->GetResultType() == TYPE_DATE)
strcat(Qbuf, "'");
} else
strcat(Qbuf, "NULL");
strcat(Qbuf, (colp->GetNext()) ? "," : ")");
} // endfor colp