diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2015-05-17 15:22:42 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2015-05-17 15:22:42 +0200 |
commit | a82171c9aa8a2edece5802e5e30ddace9c1a4a33 (patch) | |
tree | 69eb1c8b2662f4bc90957f268179c2d0ccb80931 /storage/connect/reldef.cpp | |
parent | b9c910909c3e04ceab8d0d514ba6213015787c5a (diff) | |
download | mariadb-git-a82171c9aa8a2edece5802e5e30ddace9c1a4a33.tar.gz |
In BIN table date_format now imply by default field_format='C'.
modified: storage/connect/tabfix.cpp
modified: storage/connect/reldef.cpp
Json array index (position) is now 0 based by default. This corresponds
to what all json applications and functions do. Also fix ROWNUM calculation.
modified: storage/connect/jsonudf.cpp
modified: storage/connect/mysql-test/connect/r/json.result
modified: storage/connect/mysql-test/connect/t/json.test
modified: storage/connect/tabjson.cpp
modified: storage/connect/tabjson.h
Diffstat (limited to 'storage/connect/reldef.cpp')
-rw-r--r-- | storage/connect/reldef.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index e3cea256227..0b3d4682cc7 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -333,7 +333,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g) if (nof) // Field width is the internal representation width // that can also depend on the column format - switch (cdp->Fmt ? *cdp->Fmt : 'X') { + switch (cdp->Fmt ? *cdp->Fmt : cdp->Decode ? 'C' : 'X') { case 'X': nof= cdp->Clen; case 'C': break; case 'R': @@ -346,7 +346,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g) default: /* New format */ for (nof= 0, i= 0; cdp->Fmt[i]; i++) if (isdigit(cdp->Fmt[i])) - nof= (nof * 10 + (cdp->Fmt[i] - 48)); + nof= (nof * 10 + (cdp->Fmt[i] - '0')); if (!nof) nof= cdp->Clen; @@ -377,20 +377,16 @@ int TABDEF::GetColCatInfo(PGLOBAL g) // not specified (for instance if quoted is specified) // if ((ending= Hc->GetIntegerOption("Ending")) < 0) { if ((ending= Hc->GetIntegerOption("Ending")) <= 0) { -#if defined(WIN32) - ending= 2; -#else - ending= 1; -#endif + ending= (tc == TAB_BIN || tc == TAB_VEC) ? 0 : CRLF; Hc->SetIntegerOption("Ending", ending); } // endif ending // Calculate the default record size switch (tc) { case TAB_FIX: + case TAB_BIN: recln= nlg + ending; // + length of line ending break; - case TAB_BIN: case TAB_VEC: recln= nlg; |