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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
36d2bd6a
Commit
36d2bd6a
authored
Jun 03, 2015
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle ODBC table null values modified: tabodbc.cpp
parent
e8ea671c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
storage/connect/connect.cc
storage/connect/connect.cc
+41
-1
storage/connect/tabodbc.cpp
storage/connect/tabodbc.cpp
+5
-1
storage/connect/xindex.h
storage/connect/xindex.h
+4
-0
No files found.
storage/connect/connect.cc
View file @
36d2bd6a
...
@@ -709,6 +709,28 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
...
@@ -709,6 +709,28 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
return
(
tdbp
->
To_Kindex
->
IsMul
())
?
2
:
1
;
return
(
tdbp
->
To_Kindex
->
IsMul
())
?
2
:
1
;
}
// end of CntIndexInit
}
// end of CntIndexInit
#if defined(WORDS_BIGENDIAN)
/***********************************************************************/
/* Swap bytes of the key that are written in little endian order. */
/***********************************************************************/
static
void
SetSwapValue
(
PVAL
valp
,
char
*
kp
)
{
if
(
valp
->
IsTypeNum
()
&&
valp
->
GetType
()
!=
TYPE_DECIM
)
{
uchar
buf
[
8
];
int
i
,
k
=
valp
->
GetClen
();
for
(
i
=
0
;
k
>
0
;)
buf
[
i
++
]
=
kp
[
--
k
];
valp
->
SetBinValue
((
void
*
)
buf
);
}
else
valp
->
SetBinValue
((
void
*
)
kp
);
}
// end of SetSwapValue
#endif // WORDS_BIGENDIAN
/***********************************************************************/
/***********************************************************************/
/* IndexRead: fetch a record having the index value. */
/* IndexRead: fetch a record having the index value. */
/***********************************************************************/
/***********************************************************************/
...
@@ -779,7 +801,12 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
...
@@ -779,7 +801,12 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
if
(
!
valp
->
IsTypeNum
())
{
if
(
!
valp
->
IsTypeNum
())
{
if
(
colp
->
GetColUse
(
U_VAR
))
{
if
(
colp
->
GetColUse
(
U_VAR
))
{
#if defined(WORDS_BIGENDIAN)
((
char
*
)
&
lg
)[
0
]
=
((
char
*
)
kp
)[
1
];
((
char
*
)
&
lg
)[
1
]
=
((
char
*
)
kp
)[
0
];
#else // !WORDS_BIGENDIAN
lg
=
*
(
short
*
)
kp
;
lg
=
*
(
short
*
)
kp
;
#endif //!WORDS_BIGENDIAN
kp
+=
sizeof
(
short
);
kp
+=
sizeof
(
short
);
rcb
=
valp
->
SetValue_char
(
kp
,
(
int
)
lg
);
rcb
=
valp
->
SetValue_char
(
kp
,
(
int
)
lg
);
}
else
}
else
...
@@ -797,7 +824,11 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
...
@@ -797,7 +824,11 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op,
}
// endif b
}
// endif b
}
else
}
else
#if defined(WORDS_BIGENDIAN)
SetSwapValue
(
valp
,
kp
);
#else // !WORDS_BIGENDIAN
valp
->
SetBinValue
((
void
*
)
kp
);
valp
->
SetBinValue
((
void
*
)
kp
);
#endif //!WORDS_BIGENDIAN
kp
+=
valp
->
GetClen
();
kp
+=
valp
->
GetClen
();
...
@@ -893,7 +924,12 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
...
@@ -893,7 +924,12 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
if
(
!
valp
->
IsTypeNum
())
{
if
(
!
valp
->
IsTypeNum
())
{
if
(
colp
->
GetColUse
(
U_VAR
))
{
if
(
colp
->
GetColUse
(
U_VAR
))
{
#if defined(WORDS_BIGENDIAN)
((
char
*
)
&
lg
)[
0
]
=
((
char
*
)
p
)[
1
];
((
char
*
)
&
lg
)[
1
]
=
((
char
*
)
p
)[
0
];
#else // !WORDS_BIGENDIAN
lg
=
*
(
short
*
)
p
;
lg
=
*
(
short
*
)
p
;
#endif //!WORDS_BIGENDIAN
p
+=
sizeof
(
short
);
p
+=
sizeof
(
short
);
rcb
=
valp
->
SetValue_char
((
char
*
)
p
,
(
int
)
lg
);
rcb
=
valp
->
SetValue_char
((
char
*
)
p
,
(
int
)
lg
);
}
else
}
else
...
@@ -912,7 +948,11 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
...
@@ -912,7 +948,11 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len,
}
// endif b
}
// endif b
}
else
}
else
valp
->
SetBinValue
((
void
*
)
p
);
#if defined(WORDS_BIGENDIAN)
SetSwapValue
(
valp
,
(
char
*
)
kp
);
#else // !WORDS_BIGENDIAN
valp
->
SetBinValue
((
void
*
)
kp
);
#endif // !WORDS_BIGENDIAN
if
(
trace
)
{
if
(
trace
)
{
char
bf
[
32
];
char
bf
[
32
];
...
...
storage/connect/tabodbc.cpp
View file @
36d2bd6a
...
@@ -1268,6 +1268,10 @@ void ODBCCOL::ReadColumn(PGLOBAL g)
...
@@ -1268,6 +1268,10 @@ void ODBCCOL::ReadColumn(PGLOBAL g)
}
// endif Buf_Type
}
// endif Buf_Type
// Handle null values
if
(
Value
->
IsZero
())
Value
->
SetNull
(
Nullable
);
if
(
trace
)
{
if
(
trace
)
{
char
buf
[
64
];
char
buf
[
64
];
...
@@ -1393,7 +1397,7 @@ void ODBCCOL::WriteColumn(PGLOBAL g)
...
@@ -1393,7 +1397,7 @@ void ODBCCOL::WriteColumn(PGLOBAL g)
/* -------------------------- Class TDBXDBC -------------------------- */
/* -------------------------- Class TDBXDBC -------------------------- */
/***********************************************************************/
/***********************************************************************/
/* Implementation of the TDB
O
DBC class. */
/* Implementation of the TDB
X
DBC class. */
/***********************************************************************/
/***********************************************************************/
TDBXDBC
::
TDBXDBC
(
PODEF
tdp
)
:
TDBODBC
(
tdp
)
TDBXDBC
::
TDBXDBC
(
PODEF
tdp
)
:
TDBODBC
(
tdp
)
{
{
...
...
storage/connect/xindex.h
View file @
36d2bd6a
...
@@ -65,7 +65,11 @@ typedef struct index_def : public BLOCK {
...
@@ -65,7 +65,11 @@ typedef struct index_def : public BLOCK {
typedef
struct
index_off
{
typedef
struct
index_off
{
union
{
union
{
#if defined(WORDS_BIGENDIAN)
struct
{
int
High
;
int
Low
;};
#else // !WORDS_BIGENDIAN
struct
{
int
Low
;
int
High
;};
struct
{
int
Low
;
int
High
;};
#endif //!WORDS_BIGENDIAN
longlong
Val
;
// File position
longlong
Val
;
// File position
}
;
// end of union
}
;
// end of union
}
IOFF
;
}
IOFF
;
...
...
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