Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
ba82edd4
Commit
ba82edd4
authored
Jan 24, 2013
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong).
parent
1d67d9bf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
11 deletions
+30
-11
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+1
-1
storage/connect/myutil.cpp
storage/connect/myutil.cpp
+5
-0
storage/connect/odbconn.cpp
storage/connect/odbconn.cpp
+22
-8
storage/connect/value.cpp
storage/connect/value.cpp
+2
-2
No files found.
storage/connect/ha_connect.cc
View file @
ba82edd4
...
...
@@ -162,8 +162,8 @@ PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn);
#if defined(MYSQL_SUPPORT)
PQRYRES
MyColumns
(
PGLOBAL
g
,
char
*
host
,
char
*
db
,
char
*
user
,
char
*
pwd
,
char
*
table
,
char
*
colpat
,
int
port
,
bool
key
);
enum
enum_field_types
PLGtoMYSQL
(
int
type
,
bool
gdf
);
#endif // MYSQL_SUPPORT
enum
enum_field_types
PLGtoMYSQL
(
int
type
,
bool
gdf
);
#if defined(WIN32)
PQRYRES
WMIColumns
(
PGLOBAL
g
,
char
*
nsp
,
char
*
classname
,
PWMIUT
wp
=
NULL
);
#endif // WIN32
...
...
storage/connect/myutil.cpp
View file @
ba82edd4
...
...
@@ -48,6 +48,8 @@ int MYSQLtoPLG(char *typname)
!
stricmp
(
typname
,
"time"
)
||
!
stricmp
(
typname
,
"timestamp"
)
||
!
stricmp
(
typname
,
"year"
))
type
=
TYPE_DATE
;
else
if
(
!
stricmp
(
typname
,
"bigint"
)
||
!
stricmp
(
typname
,
"longlong"
))
type
=
TYPE_BIGINT
;
else
type
=
TYPE_ERROR
;
...
...
@@ -77,6 +79,9 @@ enum enum_field_types PLGtoMYSQL(int type, bool gdf)
case
TYPE_STRING
:
mytype
=
MYSQL_TYPE_VARCHAR
;
break
;
case
TYPE_BIGINT
:
mytype
=
MYSQL_TYPE_LONGLONG
;
break
;
default:
mytype
=
MYSQL_TYPE_NULL
;
}
// endswitch mytype
...
...
storage/connect/odbconn.cpp
View file @
ba82edd4
...
...
@@ -219,8 +219,8 @@ PQRYRES ODBCColumns(PGLOBAL g, ODBConn *op, char *dsn, char *table,
/**************************************************************************/
PQRYRES
MyODBCCols
(
PGLOBAL
g
,
char
*
tab
,
char
*
dsn
)
{
int
n
;
PCOLRES
crp
;
int
type
,
len
,
prec
;
PCOLRES
crp
t
,
crpl
,
crpp
;
PQRYRES
qrp
;
ODBConn
*
ocp
=
new
(
g
)
ODBConn
(
g
,
NULL
);
...
...
@@ -247,14 +247,28 @@ PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn)
/* Keep only the info used by ha_connect::pre_create. */
/************************************************************************/
qrp
->
Colresp
=
qrp
->
Colresp
->
Next
->
Next
;
// Skip Owner and Table names
crp
=
qrp
->
Colresp
->
Next
;
// DB type
// Types must be PLG types, not SQL types
for
(
int
i
=
0
;
i
<
qrp
->
Nblin
;
i
++
)
crp
->
Kdata
->
SetValue
(
TranslateSQLType
(
crp
->
Kdata
->
GetIntValue
(
i
),
0
,
n
),
i
);
crpt
=
qrp
->
Colresp
->
Next
;
// SQL type
crpl
=
crpt
->
Next
->
Next
;
// Length
crpp
=
crpl
->
Next
->
Next
;
// Decimals
for
(
int
i
=
0
;
i
<
qrp
->
Nblin
;
i
++
)
{
// Types must be PLG types, not SQL types
type
=
crpt
->
Kdata
->
GetIntValue
(
i
);
len
=
crpl
->
Kdata
->
GetIntValue
(
i
);
prec
=
crpp
->
Kdata
->
GetIntValue
(
i
);
type
=
TranslateSQLType
(
type
,
prec
,
len
);
crpt
->
Kdata
->
SetValue
(
type
,
i
);
// Some data sources do not count prec in length
if
(
type
==
TYPE_FLOAT
)
len
+=
(
prec
+
2
);
// To be safe
// Could have been changed for blobs or numeric
crpl
->
Kdata
->
SetValue
(
len
,
i
);
}
// endfor i
crp
=
crp
->
Next
->
Next
->
Next
->
Next
;
// Should be Radix
crp
->
Next
=
crp
->
Next
->
Next
->
Next
;
// Should be Remark
crpp
->
Next
=
crpp
->
Next
->
Next
->
Next
;
// Should be Remark
qrp
->
Nbcol
=
7
;
// Was 11, skipped 4
return
qrp
;
}
// end of MyODBCCols
...
...
storage/connect/value.cpp
View file @
ba82edd4
...
...
@@ -210,7 +210,7 @@ short GetSQLType(int type)
case
TYPE_SHORT
:
tp
=
SQL_SMALLINT
;
break
;
case
TYPE_INT
:
tp
=
SQL_INTEGER
;
break
;
case
TYPE_DATE
:
tp
=
SQL_TIMESTAMP
;
break
;
case
TYPE_BIGINT
:
case
TYPE_BIGINT
:
tp
=
SQL_BIGINT
;
break
;
// (-5)
case
TYPE_FLOAT
:
tp
=
SQL_DOUBLE
;
break
;
}
// endswitch type
...
...
@@ -229,7 +229,7 @@ int GetSQLCType(int type)
case
TYPE_SHORT
:
tp
=
SQL_C_SHORT
;
break
;
case
TYPE_INT
:
tp
=
SQL_C_LONG
;
break
;
case
TYPE_DATE
:
tp
=
SQL_C_TIMESTAMP
;
break
;
case
TYPE_BIGINT
:
case
TYPE_BIGINT
:
tp
=
SQL_C_SBIGINT
;
break
;
case
TYPE_FLOAT
:
tp
=
SQL_C_DOUBLE
;
break
;
}
// endswitch type
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment