Skip to content
Permalink
Browse files

Fix MDEV-12520: Decimal values can be truncated for JDBC tables

  modified:   storage/connect/jdbconn.cpp

Fix bug. Date value was null when retrieved from a json expanded array.
  modified:   storage/connect/tabjson.cpp
  • Loading branch information...
Buggynours committed Apr 22, 2017
1 parent 3ac35bb commit a091314d2775e0d33f2476953a7c5ab9647b2f37
Showing with 4 additions and 2 deletions.
  1. +3 −2 storage/connect/jdbconn.cpp
  2. +1 −0 storage/connect/tabjson.cpp
@@ -1235,7 +1235,8 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val)
case 12: // VARCHAR
case -1: // LONGVARCHAR
case 1: // CHAR
if (jb)
case 3: // DECIMAL
if (jb && ctyp != 3)
cn = (jstring)jb;
else if (!gmID(g, chrfldid, "StringField", "(ILjava/lang/String;)Ljava/lang/String;"))
cn = (jstring)env->CallObjectMethod(job, chrfldid, (jint)rank, jn);
@@ -1261,7 +1262,7 @@ void JDBConn::SetColumnValue(int rank, PSZ name, PVAL val)
break;
case 8: // DOUBLE
case 2: // NUMERIC
case 3: // DECIMAL
//case 3: // DECIMAL
if (!gmID(g, dblfldid, "DoubleField", "(ILjava/lang/String;)D"))
val->SetValue((double)env->CallDoubleMethod(job, dblfldid, rank, jn));
else
@@ -1171,6 +1171,7 @@ void JSONCOL::SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val, int n)
case TYPE_INTG:
case TYPE_BINT:
case TYPE_DBL:
case TYPE_DATE:
vp->SetValue_pval(val->GetValue());
break;
case TYPE_BOOL:

0 comments on commit a091314

Please sign in to comment.
You can’t perform that action at this time.