summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2016-12-05 01:01:09 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2016-12-05 01:03:31 +0400
commit78dc7c3a6ed8000e7e67a1d60194c8793f9e9a40 (patch)
tree5d7b04342c4c267301585f843c4e42b5bf890e2f /strings
parent5454500562947bf369f7b984df888e2fd6eb4210 (diff)
downloadmariadb-git-78dc7c3a6ed8000e7e67a1d60194c8793f9e9a40.tar.gz
MDEV-11461 JSON_TYPE does not recognize integer/double types.
Integer/Double recognition added.
Diffstat (limited to 'strings')
-rw-r--r--strings/json_lib.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/strings/json_lib.c b/strings/json_lib.c
index 3c6cc717aac..976fab7e7f6 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -477,13 +477,29 @@ static int json_num_states[NS_NUM_STATES][N_NUM_CLASSES]=
};
+static uint json_num_state_flags[NS_NUM_STATES]=
+{
+/*OK*/ 0,
+/*GO*/ 0,
+/*GO1*/ JSON_NUM_NEG,
+/*ZERO*/ 0,
+/*ZE1*/ 0,
+/*INT*/ 0,
+/*FRAC*/ JSON_NUM_FRAC_PART,
+/*EX*/ JSON_NUM_EXP,
+/*EX1*/ 0,
+};
+
+
static int skip_num_constant(json_engine_t *j)
{
int state= json_num_states[NS_GO][json_num_chr_map[j->s.c_next]];
int c_len;
+ j->num_flags= 0;
for (;;)
{
+ j->num_flags|= json_num_state_flags[state];
if ((c_len= json_next_char(&j->s)) > 0)
{
if ((state= json_num_states[state][json_num_chr_map[j->s.c_next]]) > 0)