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
2c0bcfff
Commit
2c0bcfff
authored
Oct 24, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8693 Tests connect.bin connect.endian fail on armhf (on Debian build system)
parent
d546d1cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
storage/connect/tabfix.cpp
storage/connect/tabfix.cpp
+6
-6
storage/connect/value.h
storage/connect/value.h
+20
-0
No files found.
storage/connect/tabfix.cpp
View file @
2c0bcfff
...
...
@@ -511,29 +511,29 @@ void BINCOL::ReadColumn(PGLOBAL g)
switch
(
Fmt
)
{
case
'X'
:
// Standard not converted values
if
(
Eds
&&
IsTypeChar
(
Buf_Type
))
Value
->
SetValue
(
*
(
longlong
*
)
p
);
Value
->
SetValue
NonAligned
<
longlong
>
(
p
);
else
Value
->
SetBinValue
(
p
);
break
;
case
'S'
:
// Short integer
Value
->
SetValue
(
*
(
short
*
)
p
);
Value
->
SetValue
NonAligned
<
short
>
(
p
);
break
;
case
'T'
:
// Tiny integer
Value
->
SetValue
(
*
p
);
break
;
case
'I'
:
// Integer
Value
->
SetValue
(
*
(
int
*
)
p
);
Value
->
SetValue
NonAligned
<
int
>
(
p
);
break
;
case
'G'
:
// Large (great) integer
Value
->
SetValue
(
*
(
longlong
*
)
p
);
Value
->
SetValue
NonAligned
<
longlong
>
(
p
);
break
;
case
'F'
:
// Float
case
'R'
:
// Real
Value
->
SetValue
((
double
)
*
(
float
*
)
p
);
Value
->
SetValue
NonAligned
<
float
>
(
p
);
break
;
case
'D'
:
// Double
Value
->
SetValue
(
*
(
double
*
)
p
);
Value
->
SetValue
NonAligned
<
double
>
(
p
);
break
;
case
'C'
:
// Text
if
(
Value
->
SetValue_char
(
p
,
Long
))
{
...
...
storage/connect/value.h
View file @
2c0bcfff
...
...
@@ -116,6 +116,26 @@ class DllExport VALUE : public BLOCK {
virtual
bool
Compute
(
PGLOBAL
g
,
PVAL
*
vp
,
int
np
,
OPVAL
op
);
virtual
bool
FormatValue
(
PVAL
vp
,
char
*
fmt
)
=
0
;
/**
Set value from a non-aligned in-memory value in the machine byte order.
TYPE can be either of:
- int, short, longlong
- uint, ushort, ulonglong
- float, double
@param - a pointer to a non-aligned value of type TYPE.
*/
template
<
typename
TYPE
>
void
SetValueNonAligned
(
const
char
*
p
)
{
#if defined(__i386__) || defined(__x86_64__)
SetValue
(
*
((
TYPE
*
)
p
));
// x86 can cast non-aligned memory directly
#else
TYPE
tmp
;
// a slower version for non-x86 platforms
memcpy
(
&
tmp
,
p
,
sizeof
(
tmp
));
SetValue
(
tmp
);
#endif
}
protected:
virtual
bool
SetConstFormat
(
PGLOBAL
,
FORMAT
&
)
=
0
;
const
char
*
GetXfmt
(
void
);
...
...
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