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

- Put all jar files in the SHARE directory (was PLUGIN)

modified:   sql/mysqld.h
    modified:   storage/connect/CMakeLists.txt
    modified:   storage/connect/javaconn.cpp
    modified:   storage/connect/mycat.cc
    modified:   storage/connect/mycat.h

- Get a handled on a not pooled client
  This to avoid a .50 delay when closing
    modified:   storage/connect/cmgoconn.cpp
    modified:   storage/connect/cmgoconn.h

- Allow FIELD_FORMAT options for DECIMAL type
    modified:   storage/connect/tabdos.cpp

- Update tests and result to reflect last changes
  Also because Oracle password has changed
    modified:   storage/connect/mysql-test/connect/r/jdbc_oracle.result
    modified:   storage/connect/mysql-test/connect/r/json_java_2.result
    modified:   storage/connect/mysql-test/connect/r/json_java_3.result
    modified:   storage/connect/mysql-test/connect/r/json_mongo_c.result
    modified:   storage/connect/mysql-test/connect/r/mongo_c.result
    modified:   storage/connect/mysql-test/connect/r/odbc_oracle.result
    modified:   storage/connect/mysql-test/connect/t/jdbc_oracle.test
    modified:   storage/connect/mysql-test/connect/t/odbc_oracle.test

- Typo
    modified:   storage/connect/reldef.cpp
This commit is contained in:
Olivier Bertrand
2021-05-17 19:17:31 +02:00
parent 5ae67c6d63
commit 17533c1ffc
17 changed files with 136 additions and 106 deletions

View File

@@ -2535,6 +2535,7 @@ void DOSCOL::ReadColumn(PGLOBAL g)
char *p = NULL;
int i, rc;
int field;
bool err = false;
double dval;
PTDBDOS tdbp = (PTDBDOS)To_Tdb;
@@ -2578,33 +2579,39 @@ void DOSCOL::ReadColumn(PGLOBAL g)
case TYPE_SHORT:
case TYPE_TINY:
case TYPE_BIGINT:
if (Value->SetValue_char(p, field - Dcm)) {
sprintf(g->Message, "Out of range value for column %s at row %d",
Name, tdbp->RowNumber(g));
PushWarning(g, tdbp);
} // endif SetValue_char
err = Value->SetValue_char(p, field - Dcm);
break;
case TYPE_DOUBLE:
Value->SetValue_char(p, field);
dval = Value->GetFloatValue();
if (!(err = Value->SetValue_char(p, field))) {
dval = Value->GetFloatValue();
for (i = 0; i < Dcm; i++)
dval /= 10.0;
for (i = 0; i < Dcm; i++)
dval /= 10.0;
Value->SetValue(dval);
} // endif err
Value->SetValue(dval);
break;
default:
Value->SetValue_char(p, field);
err = Value->SetValue_char(p, field);
if (!err && Buf_Type == TYPE_DECIM) {
char* s = Value->GetCharValue();
if (!(err = ((i = strlen(s)) >= Value->GetClen()))) {
for (int d = Dcm + 1; d; i--, d--)
s[i + 1] = s[i];
s[i + 1] = '.';
} // endif err
} // endif DECIM
break;
} // endswitch Buf_Type
} // endswitch Buf_Type
else
if (Value->SetValue_char(p, field)) {
sprintf(g->Message, "Out of range value for column %s at row %d",
Name, tdbp->RowNumber(g));
PushWarning(g, tdbp);
} // endif SetValue_char
err = Value->SetValue_char(p, field);
break;
default:
@@ -2612,6 +2619,12 @@ void DOSCOL::ReadColumn(PGLOBAL g)
throw 34;
} // endswitch Ftype
if (err) {
sprintf(g->Message, "Out of range value for column %s at row %d",
Name, tdbp->RowNumber(g));
PushWarning(g, tdbp);
} // endif err
// Set null when applicable
if (Nullable)
Value->SetNull(Value->IsZero());
@@ -2702,7 +2715,7 @@ void DOSCOL::WriteColumn(PGLOBAL g)
case TYPE_DECIM:
strcpy(fmt, (Ldz) ? "%0*.*lf" : "%*.*lf");
len = field + ((Nod && Dcm) ? 1 : 0);
snprintf(Buf, len, fmt, len, Dcm, Value->GetFloatValue());
snprintf(Buf, len + 1, fmt, len, Dcm, Value->GetFloatValue());
len = strlen(Buf);
if (Nod && Dcm)