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
cd9b9199
Commit
cd9b9199
authored
Aug 14, 2015
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ob-10.0' into 10.0
parents
0eacebf1
6d46c977
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
storage/connect/odbconn.cpp
storage/connect/odbconn.cpp
+4
-2
storage/connect/tabjson.cpp
storage/connect/tabjson.cpp
+9
-3
storage/connect/value.cpp
storage/connect/value.cpp
+13
-9
No files found.
storage/connect/odbconn.cpp
View file @
cd9b9199
...
@@ -2360,9 +2360,11 @@ int ODBConn::GetCatInfo(CATPARM *cap)
...
@@ -2360,9 +2360,11 @@ int ODBConn::GetCatInfo(CATPARM *cap)
}
// endif rc
}
// endif rc
for
(
n
=
0
,
crp
=
qrp
->
Colresp
;
crp
;
n
++
,
crp
=
crp
->
Next
)
{
for
(
n
=
0
,
crp
=
qrp
->
Colresp
;
crp
;
n
++
,
crp
=
crp
->
Next
)
{
if
(
vlen
[
n
]
==
SQL_NULL_DATA
)
if
(
vlen
[
n
]
==
SQL_NO_TOTAL
)
ThrowDBX
(
"Unexpected SQL_NO_TOTAL returned from SQLFetch"
);
else
if
(
vlen
[
n
]
==
SQL_NULL_DATA
)
pval
[
n
]
->
SetNull
(
true
);
pval
[
n
]
->
SetNull
(
true
);
else
if
(
crp
->
Type
==
TYPE_STRING
&&
vlen
[
n
]
!=
SQL_NULL_DATA
)
else
if
(
crp
->
Type
==
TYPE_STRING
/* && vlen[n] != SQL_NULL_DATA*/
)
pval
[
n
]
->
SetValue_char
(
pbuf
[
n
],
vlen
[
n
]);
pval
[
n
]
->
SetValue_char
(
pbuf
[
n
],
vlen
[
n
]);
else
else
pval
[
n
]
->
SetNull
(
false
);
pval
[
n
]
->
SetNull
(
false
);
...
...
storage/connect/tabjson.cpp
View file @
cd9b9199
...
@@ -755,7 +755,7 @@ int TDBJSN::MakeTopTree(PGLOBAL g, PJSON jsp)
...
@@ -755,7 +755,7 @@ int TDBJSN::MakeTopTree(PGLOBAL g, PJSON jsp)
}
else
}
else
strcpy
(
To_Line
,
s
);
strcpy
(
To_Line
,
s
);
Row
->
Clear
();
//
Row->Clear();
return
false
;
return
false
;
}
else
}
else
return
true
;
return
true
;
...
@@ -979,7 +979,8 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
...
@@ -979,7 +979,8 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
if
(
!
stricmp
(
Name
,
colp
->
GetName
()))
{
if
(
!
stricmp
(
Name
,
colp
->
GetName
()))
{
Nod
=
colp
->
Nod
;
Nod
=
colp
->
Nod
;
Nodes
=
colp
->
Nodes
;
Nodes
=
colp
->
Nodes
;
goto
fin
;
Xpd
=
colp
->
Xpd
;
goto
fin
;
}
// endif Name
}
// endif Name
sprintf
(
g
->
Message
,
"Cannot parse updated column %s"
,
Name
);
sprintf
(
g
->
Message
,
"Cannot parse updated column %s"
,
Name
);
...
@@ -1347,7 +1348,12 @@ PJSON JSONCOL::GetRow(PGLOBAL g)
...
@@ -1347,7 +1348,12 @@ PJSON JSONCOL::GetRow(PGLOBAL g)
/***********************************************************************/
/***********************************************************************/
void
JSONCOL
::
WriteColumn
(
PGLOBAL
g
)
void
JSONCOL
::
WriteColumn
(
PGLOBAL
g
)
{
{
/*********************************************************************/
if
(
Xpd
&&
Tjp
->
Pretty
<
2
)
{
strcpy
(
g
->
Message
,
"Cannot write expanded column when Pretty is not 2"
);
longjmp
(
g
->
jumper
[
g
->
jump_level
],
666
);
}
// endif Xpd
/*********************************************************************/
/* Check whether this node must be written. */
/* Check whether this node must be written. */
/*********************************************************************/
/*********************************************************************/
if
(
Value
!=
To_Val
)
if
(
Value
!=
To_Val
)
...
...
storage/connect/value.cpp
View file @
cd9b9199
...
@@ -103,6 +103,7 @@ ulonglong CharToNumber(char *p, int n, ulonglong maxval,
...
@@ -103,6 +103,7 @@ ulonglong CharToNumber(char *p, int n, ulonglong maxval,
if
(
minus
)
*
minus
=
false
;
if
(
minus
)
*
minus
=
false
;
if
(
rc
)
*
rc
=
false
;
if
(
rc
)
*
rc
=
false
;
if
(
n
<=
0
)
return
0LL
;
// Eliminate leading blanks or 0
// Eliminate leading blanks or 0
for
(
p2
=
p
+
n
;
p
<
p2
&&
(
*
p
==
' '
||
*
p
==
'0'
);
p
++
)
;
for
(
p2
=
p
+
n
;
p
<
p2
&&
(
*
p
==
' '
||
*
p
==
'0'
);
p
++
)
;
...
@@ -705,7 +706,7 @@ bool TYPVAL<TYPE>::SetValue_char(char *p, int n)
...
@@ -705,7 +706,7 @@ bool TYPVAL<TYPE>::SetValue_char(char *p, int n)
template
<
>
template
<
>
bool
TYPVAL
<
double
>::
SetValue_char
(
char
*
p
,
int
n
)
bool
TYPVAL
<
double
>::
SetValue_char
(
char
*
p
,
int
n
)
{
{
if
(
p
)
{
if
(
p
&&
n
>
0
)
{
char
buf
[
64
];
char
buf
[
64
];
for
(;
n
>
0
&&
*
p
==
' '
;
p
++
)
for
(;
n
>
0
&&
*
p
==
' '
;
p
++
)
...
@@ -1345,7 +1346,7 @@ bool TYPVAL<PSZ>::SetValue_char(char *p, int n)
...
@@ -1345,7 +1346,7 @@ bool TYPVAL<PSZ>::SetValue_char(char *p, int n)
{
{
bool
rc
;
bool
rc
;
if
(
p
)
{
if
(
p
&&
n
>
0
)
{
rc
=
n
>
Len
;
rc
=
n
>
Len
;
if
((
n
=
MY_MIN
(
n
,
Len
)))
{
if
((
n
=
MY_MIN
(
n
,
Len
)))
{
...
@@ -1804,7 +1805,7 @@ bool DECVAL::SetValue_char(char *p, int n)
...
@@ -1804,7 +1805,7 @@ bool DECVAL::SetValue_char(char *p, int n)
{
{
bool rc;
bool rc;
if (p) {
if (p
&& n > 0
) {
rc = n > Len;
rc = n > Len;
if ((n = MY_MIN(n, Len))) {
if ((n = MY_MIN(n, Len))) {
...
@@ -2095,7 +2096,7 @@ bool BINVAL::SetValue_char(char *p, int n)
...
@@ -2095,7 +2096,7 @@ bool BINVAL::SetValue_char(char *p, int n)
{
{
bool
rc
;
bool
rc
;
if
(
p
)
{
if
(
p
&&
n
>
0
)
{
rc
=
n
>
Clen
;
rc
=
n
>
Clen
;
Len
=
MY_MIN
(
n
,
Clen
);
Len
=
MY_MIN
(
n
,
Clen
);
memcpy
(
Binp
,
p
,
Len
);
memcpy
(
Binp
,
p
,
Len
);
...
@@ -2672,13 +2673,16 @@ bool DTVAL::SetValue_char(char *p, int n)
...
@@ -2672,13 +2673,16 @@ bool DTVAL::SetValue_char(char *p, int n)
int
ndv
;
int
ndv
;
int
dval
[
6
];
int
dval
[
6
];
// Trim trailing blanks
if
(
n
>
0
)
{
for
(
p2
=
p
+
n
-
1
;
p
<
p2
&&
*
p2
==
' '
;
p2
--
)
;
// Trim trailing blanks
for
(
p2
=
p
+
n
-
1
;
p
<
p2
&&
*
p2
==
' '
;
p2
--
);
if
((
rc
=
(
n
=
p2
-
p
+
1
)
>
Len
))
if
((
rc
=
(
n
=
p2
-
p
+
1
)
>
Len
))
n
=
Len
;
n
=
Len
;
memcpy
(
Sdate
,
p
,
n
);
}
// endif n
memcpy
(
Sdate
,
p
,
n
);
Sdate
[
n
]
=
'\0'
;
Sdate
[
n
]
=
'\0'
;
ndv
=
ExtractDate
(
Sdate
,
Pdtp
,
DefYear
,
dval
);
ndv
=
ExtractDate
(
Sdate
,
Pdtp
,
DefYear
,
dval
);
...
...
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