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
6a94ad98
Commit
6a94ad98
authored
Nov 04, 2020
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crash on Json date columns
parent
49428c8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
storage/connect/json.cpp
storage/connect/json.cpp
+11
-1
storage/connect/plgdbsem.h
storage/connect/plgdbsem.h
+1
-1
storage/connect/value.h
storage/connect/value.h
+2
-1
No files found.
storage/connect/json.cpp
View file @
6a94ad98
...
@@ -1587,7 +1587,17 @@ void JVALUE::SetValue(PGLOBAL g, PVAL valp)
...
@@ -1587,7 +1587,17 @@ void JVALUE::SetValue(PGLOBAL g, PVAL valp)
Val
->
Type
=
TYPE_NULL
;
Val
->
Type
=
TYPE_NULL
;
}
else
switch
(
valp
->
GetType
())
{
}
else
switch
(
valp
->
GetType
())
{
case
TYPE_STRING
:
case
TYPE_STRING
:
case
TYPE_DATE
:
if
(((
DTVAL
*
)
valp
)
->
IsFormatted
())
Val
->
Strp
=
valp
->
GetCharValue
();
else
{
char
buf
[
32
];
Val
->
Strp
=
PlugDup
(
g
,
valp
->
GetCharString
(
buf
));
}
// endif Formatted
Val
->
Type
=
TYPE_DTM
;
break
;
case
TYPE_DATE
:
Val
->
Strp
=
valp
->
GetCharValue
();
Val
->
Strp
=
valp
->
GetCharValue
();
Val
->
Type
=
TYPE_STRG
;
Val
->
Type
=
TYPE_STRG
;
break
;
break
;
...
...
storage/connect/plgdbsem.h
View file @
6a94ad98
...
@@ -160,7 +160,7 @@ enum RECFM {RECFM_DFLT = 0, /* Default table type */
...
@@ -160,7 +160,7 @@ enum RECFM {RECFM_DFLT = 0, /* Default table type */
RECFM_FMT
=
8
,
/* FMT formatted file */
RECFM_FMT
=
8
,
/* FMT formatted file */
RECFM_VCT
=
9
,
/* VCT formatted files */
RECFM_VCT
=
9
,
/* VCT formatted files */
RECFM_XML
=
10
,
/* XML formatted files */
RECFM_XML
=
10
,
/* XML formatted files */
RECFM_J
ASON
=
11
,
/* JASON formatted files
*/
RECFM_J
SON
=
11
,
/* JSON formatted files
*/
RECFM_DIR
=
12
,
/* DIR table */
RECFM_DIR
=
12
,
/* DIR table */
RECFM_ODBC
=
13
,
/* Table accessed via ODBC */
RECFM_ODBC
=
13
,
/* Table accessed via ODBC */
RECFM_JDBC
=
14
,
/* Table accessed via JDBC */
RECFM_JDBC
=
14
,
/* Table accessed via JDBC */
...
...
storage/connect/value.h
View file @
6a94ad98
...
@@ -418,7 +418,8 @@ class DllExport DTVAL : public TYPVAL<int> {
...
@@ -418,7 +418,8 @@ class DllExport DTVAL : public TYPVAL<int> {
virtual
bool
SetValue_char
(
const
char
*
p
,
int
n
);
virtual
bool
SetValue_char
(
const
char
*
p
,
int
n
);
virtual
void
SetValue_psz
(
PCSZ
s
);
virtual
void
SetValue_psz
(
PCSZ
s
);
virtual
void
SetValue_pvblk
(
PVBLK
blk
,
int
n
);
virtual
void
SetValue_pvblk
(
PVBLK
blk
,
int
n
);
virtual
char
*
GetCharString
(
char
*
p
);
virtual
PSZ
GetCharValue
(
void
)
{
return
Sdate
;
}
virtual
char
*
GetCharString
(
char
*
p
);
virtual
int
ShowValue
(
char
*
buf
,
int
len
);
virtual
int
ShowValue
(
char
*
buf
,
int
len
);
virtual
bool
FormatValue
(
PVAL
vp
,
PCSZ
fmt
);
virtual
bool
FormatValue
(
PVAL
vp
,
PCSZ
fmt
);
bool
SetFormat
(
PGLOBAL
g
,
PCSZ
fmt
,
int
len
,
int
year
=
0
);
bool
SetFormat
(
PGLOBAL
g
,
PCSZ
fmt
,
int
len
,
int
year
=
0
);
...
...
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