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
26b00be3
Commit
26b00be3
authored
Jan 29, 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
a9d06e10
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
41 deletions
+53
-41
storage/connect/CMakeLists.txt
storage/connect/CMakeLists.txt
+2
-2
storage/connect/valblk.cpp
storage/connect/valblk.cpp
+2
-2
storage/connect/valblk.h
storage/connect/valblk.h
+1
-1
storage/connect/value.cpp
storage/connect/value.cpp
+44
-32
storage/connect/value.h
storage/connect/value.h
+4
-4
No files found.
storage/connect/CMakeLists.txt
View file @
26b00be3
...
...
@@ -130,9 +130,9 @@ OPTION(CONNECT_WITH_MYSQL
IF
(
CONNECT_WITH_MYSQL
)
SET
(
CONNECT_SOURCES
${
CONNECT_SOURCES
}
myconn.cpp tabmysql.cpp
)
# For static linking
SET
(
MYSQL_LIBRARY mysqlclient
)
#
SET(MYSQL_LIBRARY mysqlclient)
# For dynamic linking
#
SET(MYSQL_LIBRARY libmysql)
SET
(
MYSQL_LIBRARY libmysql
)
add_definitions
(
-DMYSQL_SUPPORT
)
IF
(
!UNIX
)
#
...
...
storage/connect/valblk.cpp
View file @
26b00be3
/************ Valblk C++ Functions Source Code File (.CPP) *************/
/* Name: VALBLK.CPP Version 1.
4
*/
/* Name: VALBLK.CPP Version 1.
5
*/
/* */
/* (C) Copyright to the author Olivier BERTRAND 2005-201
2
*/
/* (C) Copyright to the author Olivier BERTRAND 2005-201
3
*/
/* */
/* This file contains the VALBLK and derived classes functions. */
/* Second family is VALBLK, representing simple suballocated arrays */
...
...
storage/connect/valblk.h
View file @
26b00be3
...
...
@@ -274,7 +274,7 @@ class DATBLK : public LNGBLK {
};
// end of class DATBLK
/***********************************************************************/
/* Class
LNGBLK: represents a block of int integer values.
*/
/* Class
BIGBLK: represents a block of big integer values.
*/
/***********************************************************************/
class
BIGBLK
:
public
VALBLK
{
public:
...
...
storage/connect/value.cpp
View file @
26b00be3
...
...
@@ -19,8 +19,8 @@
/* to avoid too complicated classes and unuseful duplication of many */
/* functions used on one family only. The drawback is that for new */
/* types of objects, we shall have more classes to update. */
/* Currently the only implemented types are STRING,
int, DOUBLE and
*/
/*
DATE. Shortly we should add at least int VARCHAR and LONGLONG.
*/
/* Currently the only implemented types are STRING,
INT, DOUBLE, DATE
*/
/*
and LONGLONG. Shortly we should add at least TINY and VARCHAR.
*/
/***********************************************************************/
#ifndef __VALUE_H
...
...
@@ -195,7 +195,6 @@ int GetDBType(int type)
return
tp
;
}
// end of GetPLGType
/***********************************************************************/
/* GetFormatType: returns the FORMAT character(s) according to type. */
/***********************************************************************/
...
...
@@ -293,7 +292,7 @@ int ConvertType(int target, int type, CONV kind, bool match)
:
(
target
==
TYPE_INT
||
type
==
TYPE_INT
)
?
TYPE_INT
:
TYPE_SHORT
;
default:
if
(
!
target
||
target
==
type
)
if
(
target
==
TYPE_ERROR
||
target
==
type
)
return
type
;
if
(
match
&&
((
IsTypeChar
(
target
)
&&
!
IsTypeChar
(
type
))
||
...
...
@@ -711,11 +710,11 @@ char *STRING::GetIntString(char *p, int n)
}
// end of GetIntString
/***********************************************************************/
/* STRING Get
IntString: get big int representation of a char value.
*/
/* STRING Get
BigintString: get big int representation of a char value.
*/
/***********************************************************************/
char
*
STRING
::
GetBigintString
(
char
*
p
,
int
n
)
{
sprintf
(
p
,
"%*lld"
,
n
,
atol
(
Strp
));
sprintf
(
p
,
"%*lld"
,
n
,
atol
l
(
Strp
));
return
p
;
}
// end of GetBigintString
...
...
@@ -1237,7 +1236,7 @@ void STRING::SetMax(PVAL vp)
}
// end of SetMax
/***********************************************************************/
/* SetM
in: used by QUERY for the aggregate function MIN
. */
/* SetM
ax: used by QUERY for the aggregate function MAX
. */
/***********************************************************************/
void
STRING
::
SetMax
(
PVBLK
vbp
,
int
i
)
{
...
...
@@ -1246,10 +1245,10 @@ void STRING::SetMax(PVBLK vbp, int i)
if
(((
Ci
)
?
stricmp
(
val
,
Strp
)
:
strcmp
(
val
,
Strp
))
>
0
)
strcpy
(
Strp
,
val
);
}
// end of SetM
in
}
// end of SetM
ax
/***********************************************************************/
/* SetM
in: used by QUERY for the aggregate function MIN
. */
/* SetM
ax: used by QUERY for the aggregate function MAX
. */
/***********************************************************************/
void
STRING
::
SetMax
(
PVBLK
vbp
,
int
j
,
int
k
)
{
...
...
@@ -1263,10 +1262,10 @@ void STRING::SetMax(PVBLK vbp, int j, int k)
}
// endfor i
}
// end of SetM
in
}
// end of SetM
ax
/***********************************************************************/
/* SetM
in: used by QUERY for the aggregate function MIN
. */
/* SetM
ax: used by QUERY for the aggregate function MAX
. */
/***********************************************************************/
void
STRING
::
SetMax
(
PVBLK
vbp
,
int
*
x
,
int
j
,
int
k
)
{
...
...
@@ -1280,7 +1279,7 @@ void STRING::SetMax(PVBLK vbp, int *x, int j, int k)
}
// endfor i
}
// end of SetM
in
}
// end of SetM
ax
/***********************************************************************/
/* STRING SetFormat function (used to set SELECT output format). */
...
...
@@ -1757,12 +1756,13 @@ bool SHVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
return
true
;
}
// endswitch op
if
(
trace
)
if
(
np
=
1
)
htrc
(
" result=%hd val=%hd op=%d
\n
"
,
Sval
,
val
[
0
],
op
);
else
htrc
(
" result=%hd val=%hd,%hd op=%d
\n
"
,
Sval
,
val
[
0
],
val
[
1
],
op
);
if
(
trace
)
{
if
(
np
=
1
)
htrc
(
" result=%hd val=%hd op=%d
\n
"
,
Sval
,
val
[
0
],
op
);
else
htrc
(
" result=%hd val=%hd,%hd op=%d
\n
"
,
Sval
,
val
[
0
],
val
[
1
],
op
);
}
// endif trace
}
// endif op
...
...
@@ -2257,7 +2257,7 @@ char *INTVAL::GetFloatString(char *p, int n, int prec)
}
// end of GetFloatString
/***********************************************************************/
/* INTVAL compare value with another Value.
*/
/* INTVAL compare value with another Value. */
/***********************************************************************/
bool
INTVAL
::
IsEqual
(
PVAL
vp
,
bool
chktype
)
{
...
...
@@ -2272,7 +2272,7 @@ bool INTVAL::IsEqual(PVAL vp, bool chktype)
/***********************************************************************/
/* Compare values and returns 1, 0 or -1 according to comparison. */
/* This function is used for evaluation of int integer filters. */
/* This function is used for evaluation of int integer filters.
*/
/***********************************************************************/
int
INTVAL
::
CompareValue
(
PVAL
vp
)
{
...
...
@@ -2506,12 +2506,13 @@ bool INTVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
return
true
;
}
// endswitch op
if
(
trace
)
if
(
np
=
1
)
htrc
(
" result=%d val=%d op=%d
\n
"
,
Ival
,
val
[
0
],
op
);
else
htrc
(
" result=%d val=%d,%d op=%d
\n
"
,
Ival
,
val
[
0
],
val
[
1
],
op
);
if
(
trace
)
{
if
(
np
=
1
)
htrc
(
" result=%d val=%d op=%d
\n
"
,
Ival
,
val
[
0
],
op
);
else
htrc
(
" result=%d val=%d,%d op=%d
\n
"
,
Ival
,
val
[
0
],
val
[
1
],
op
);
}
// endif trace
}
// endif op
...
...
@@ -2783,7 +2784,7 @@ bool INTVAL::SetConstFormat(PGLOBAL g, FORMAT& fmt)
}
// end of SetConstFormat
/***********************************************************************/
/* Make file output of a int object. */
/* Make file output of a int object.
*/
/***********************************************************************/
void
INTVAL
::
Print
(
PGLOBAL
g
,
FILE
*
f
,
uint
n
)
{
...
...
@@ -2796,7 +2797,7 @@ void INTVAL::Print(PGLOBAL g, FILE *f, uint n)
}
/* end of Print */
/***********************************************************************/
/* Make string output of a int object. */
/* Make string output of a int object.
*/
/***********************************************************************/
void
INTVAL
::
Print
(
PGLOBAL
g
,
char
*
ps
,
uint
z
)
{
...
...
@@ -4162,7 +4163,7 @@ DFVAL::DFVAL(PSZ s, int prec) : VALUE(TYPE_FLOAT)
}
// end of DFVAL constructor
/***********************************************************************/
/* DFVAL public constructor from short.
*/
/* DFVAL public constructor from short. */
/***********************************************************************/
DFVAL
::
DFVAL
(
short
n
,
int
prec
)
:
VALUE
(
TYPE_FLOAT
)
{
...
...
@@ -4172,7 +4173,7 @@ DFVAL::DFVAL(short n, int prec) : VALUE(TYPE_FLOAT)
}
// end of DFVAL constructor
/***********************************************************************/
/* DFVAL public constructor from int. */
/* DFVAL public constructor from int.
*/
/***********************************************************************/
DFVAL
::
DFVAL
(
int
n
,
int
prec
)
:
VALUE
(
TYPE_FLOAT
)
{
...
...
@@ -4181,6 +4182,16 @@ DFVAL::DFVAL(int n, int prec) : VALUE(TYPE_FLOAT)
Clen
=
sizeof
(
double
);
}
// end of DFVAL constructor
/***********************************************************************/
/* DFVAL public constructor from big int. */
/***********************************************************************/
DFVAL
::
DFVAL
(
longlong
n
,
int
prec
)
:
VALUE
(
TYPE_FLOAT
)
{
Fval
=
(
double
)
n
;
Prec
=
prec
;
Clen
=
sizeof
(
double
);
}
// end of DFVAL constructor
/***********************************************************************/
/* DFVAL public constructor from double. */
/***********************************************************************/
...
...
@@ -4513,12 +4524,13 @@ bool DFVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
return
true
;
}
// endswitch op
if
(
trace
)
if
(
trace
)
{
if
(
np
==
1
)
htrc
(
"Compute result=%lf val=%lf op=%d
\n
"
,
Fval
,
val
[
0
],
op
);
else
htrc
(
"Compute result=%lf val=%lf,%lf op=%d
\n
"
,
Fval
,
val
[
0
],
val
[
1
],
op
);
Fval
,
val
[
0
],
val
[
1
],
op
);
}
// endif trace
return
false
;
}
// end of Compute
...
...
storage/connect/value.h
View file @
26b00be3
...
...
@@ -169,7 +169,7 @@ class STRING : public VALUE {
virtual
PSZ
GetCharValue
(
void
)
{
return
Strp
;}
virtual
short
GetShortValue
(
void
)
{
return
(
short
)
atoi
(
Strp
);}
virtual
int
GetIntValue
(
void
)
{
return
atol
(
Strp
);}
virtual
longlong
GetBigintValue
(
void
)
{
return
strtoll
(
Strp
,
NULL
,
10
);}
virtual
longlong
GetBigintValue
(
void
)
{
return
atoll
(
Strp
);}
virtual
double
GetFloatValue
(
void
)
{
return
atof
(
Strp
);}
virtual
void
*
GetTo_Val
(
void
)
{
return
Strp
;}
...
...
@@ -449,8 +449,8 @@ class DllExport BIGVAL : public VALUE {
// Implementation
virtual
bool
IsTypeNum
(
void
)
{
return
true
;}
virtual
bool
IsZero
(
void
)
{
return
Lval
==
0
;}
virtual
void
Reset
(
void
)
{
Lval
=
0
;}
virtual
bool
IsZero
(
void
)
{
return
Lval
==
0
LL
;}
virtual
void
Reset
(
void
)
{
Lval
=
0
LL
;}
virtual
int
GetValLen
(
void
);
virtual
int
GetValPrec
()
{
return
0
;}
virtual
int
GetSize
(
void
)
{
return
sizeof
(
longlong
);}
...
...
@@ -465,7 +465,7 @@ class DllExport BIGVAL : public VALUE {
virtual
bool
SetValue_pval
(
PVAL
valp
,
bool
chktype
);
virtual
void
SetValue_char
(
char
*
p
,
int
n
);
virtual
void
SetValue_psz
(
PSZ
s
);
virtual
void
SetValue_bool
(
bool
b
)
{
Lval
=
(
b
)
?
1
:
0
;}
virtual
void
SetValue_bool
(
bool
b
)
{
Lval
=
(
b
)
?
1
LL
:
0LL
;}
virtual
void
SetValue
(
short
i
)
{
Lval
=
(
longlong
)
i
;}
virtual
void
SetValue
(
int
n
)
{
Lval
=
(
longlong
)
n
;}
virtual
void
SetValue
(
longlong
n
)
{
Lval
=
n
;}
...
...
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