Skip to content

Commit

Permalink
Merge branch 'ob-10.0' into 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Buggynours committed May 21, 2016
2 parents ab62154 + d25fd43 commit da34a8c
Show file tree
Hide file tree
Showing 5 changed files with 454 additions and 333 deletions.
34 changes: 23 additions & 11 deletions storage/connect/ha_connect.cc
Expand Up @@ -119,6 +119,7 @@
#undef OFFSET

#define NOPARSE
#define NJDBC
#if defined(UNIX)
#include "osutil.h"
#endif // UNIX
Expand All @@ -128,7 +129,7 @@
#include "odbccat.h"
#endif // ODBC_SUPPORT
#if defined(JDBC_SUPPORT)
#include "jdbccat.h"
#include "tabjdbc.h"
#include "jdbconn.h"
#endif // JDBC_SUPPORT
#include "xtable.h"
Expand Down Expand Up @@ -5224,7 +5225,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
#endif
#if defined(JDBC_SUPPORT)
driver= GetListOption(g, "Driver", topt->oplist, NULL);
url= GetListOption(g, "URL", topt->oplist, NULL);
// url= GetListOption(g, "URL", topt->oplist, NULL);
tabtyp = GetListOption(g, "Tabtype", topt->oplist, NULL);
#endif // JDBC_SUPPORT
mxe= atoi(GetListOption(g,"maxerr", topt->oplist, "0"));
Expand Down Expand Up @@ -5325,18 +5326,31 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
case TAB_JDBC:
if (fnc & FNC_DRIVER) {
ok= true;
} else if (!url && !(url= strz(g, create_info->connect_string))) {
} else if (!(url= strz(g, create_info->connect_string))) {
strcpy(g->Message, "Missing URL");
} else {
// Store ODBC additional parameters
// Store JDBC additional parameters
int rc;
PJDBCDEF jdef= new(g) JDBCDEF();

jdef->SetName(create_info->alias);
sjp= (PJPARM)PlugSubAlloc(g, NULL, sizeof(JDBCPARM));
sjp->Driver= driver;
sjp->Url= url;
sjp->User= (char*)user;
sjp->Pwd= (char*)pwd;
sjp->Fsize= 0;
sjp->Scrollable= false;
ok= true;

if ((rc = jdef->ParseURL(g, url, false)) == RC_OK) {
sjp->Url= url;
sjp->User= (char*)user;
sjp->Pwd= (char*)pwd;
ok= true;
} else if (rc == RC_NF) {
if (jdef->GetTabname())
tab= jdef->GetTabname();

ok= jdef->SetParms(sjp);
} // endif rc

} // endif's

supfnc |= (FNC_DRIVER | FNC_TABLE);
Expand Down Expand Up @@ -5775,12 +5789,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd,

switch (typ) {
case TYPE_DOUBLE:
case TYPE_DECIM:
// Some data sources do not count dec in length (prec)
prec += (dec + 2); // To be safe
break;
case TYPE_DECIM:
prec= len;
break;
default:
dec= 0;
} // endswitch typ
Expand Down

0 comments on commit da34a8c

Please sign in to comment.