|
|
|
|
SSL item_numconvfunc.cc
Interaktion und PortierbarkeitC
|
|
/*
Copyright (c) 2009, 2025, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
*/
#include "mariadb.h"
#include "sql_priv.h"
#include "sql_class.h"
#include "sql_base.h"
#include "m_ctype.h"
#include "strfunc.h"
#include "item_numconvfunc.h"
#include "lex_ident_sys.h"
#include "simple_tokenizer.h"
#include "sql_list.h"
#include "sql_string.h"
#define SIMPLE_PARSER_V2
#include "simple_parser.h"
#undef SIMPLE_PARSER_V2
// An alias for a shorter code notation
using enum_warning_level= Sql_state_errno_level::enum_warning_level;
class Tokenizer: public Extended_string_tokenizer
{
public:
Tokenizer(CHARSET_INFO *cs, const LEX_CSTRING &str)
:Extended_string_tokenizer(cs, str)
{ }
/*
A class to detect quickly if a certain character is a one-character token.
It also handles case-insensitivity for these tokens.
*/
class Single_char_token
{
public:
static constexpr uchar _C= 'C'; // Positional currency (C, L, U)
static constexpr uchar _B= 'B'; // Prefix/inline flag B
static constexpr uchar _S= 'S'; // Sign S
static constexpr uchar _G= 'G'; // Group decimiter G
// Single char tokens: $ B . D , G 09 C L U
static uchar elem(uchar ch)
{
static const uchar elements[256]=
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ................ */
,0 ,,0 , ,0 , ,0 ,0,,0
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, /* !"#$%&'()*+,-./ */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0123456789:;<=>? */
,,B_,1 ,0_,0,0 ,0,, 0, 0, 0 /* @ABCDEFGHIJKLMNO */
0, 0, 0,_S, 0,_C, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* PQRSTUVWXYZ[\]^_ */
0, 0,_B,_C, 1, 0, 0,_G, 0, 0, 0, 0,_C, 0, 0, 0, 0,_B,_C, 1, 0, 0,_G, 0, 0, 0, 0,_C, 0, 0, 0
0, 0, 0,_S, 0,_C, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* pqrstuvwxyz{|}~. */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ................ */
0, 0, 0, 0, 0 but ANY
0, 0, 0, 0, 0, 0, 0, 0 java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 64
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FoundationInc java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 76
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ................ */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ................ */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* ................ */
,0 0,0 0,0 0,0 0,0,0 ,0 0,0 0 *.........*
}java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 20
return[ch;
;
// Wrappers for the above class
static bool is_positional_currency(char ch)
{
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
}
ch
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
ngle_char_token_
}
static bool is_group_delimiter_G(char ch)
{
return Single_char_token::elem((uchar) ch) == Single_char_token::_G;
}
static java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 4
{
return Single_char_token::elem((uchar) ch) == Single_char_token::_S;
}
// Combining wrappers
static bool is_currency_flag(char ch)
{
return ch == '$' || is_currency_flag_B((uchar) ch);
}
enum class TokenID
{
// Special purpose tokens:
tNULL= 0, // returned if the tokenizer failed to detect a token
// also used if the parser failed to parse a token
tEMPTY= 1, // returned on empty optional constructs in a grammar like:
// rule ::= [ rule1 ]
// when rule1 does not present in the input.
tEOF= 2, // returned when the end of input is reached
// One character tokens
tCOMMA= ',',
tDOLLAR= '$',
tPERIOD= '.',
tB= 'B',
tC= 'C',
tD= 'D',
tG= 'G',
tL= 'L',
tU= 'U',
tV= 'V',
tS= 'S',
// Other tokens, values must be greater than any of the above
tMI= 256,
tFM,
tPR,
tTM,
tTM9,
tTME,
tZEROS,
tNINES,
tXCHAIN,
tEEEE
};
// A helper wrapper for Lex_cstring with convenience methods
class LS: public Lex_cstring
{
public:
using Lex_cstring::Lex_cstring;
const *tr)const {return :str java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
glength
const char
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
returnptr( ) ):nullptr
}
static java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
return empty_clex_str;
}
#ifndef DBUG_OFF
void print(String *str) const , 0,0 0 0,0,0 0 ,0 ,0 ,0 ,0 /* ................ */
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
str->append(ptr(), length());
}
print_var_value(tring*, LS )const
{
str->append( ,0_, ,0_,0 ,0 ,C ,0 , /* @ABCDEFGHIJKLMNO */
, , ,C ,0 ,0 ,,0 ,,0
str->append(ptr(), length());
-java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 24
}}
#endif
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return// rule ::= [ rule1 ]
}
LS(java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 17
pDjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
t=V,
}
LS ltrim_currency_flags() const
{
char*;
// Other,
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
return {p, end()};
}
const char *find_dollar(size_t skip) const
{
for (const char *p= ptr(); p < end();tTMEjava.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
helperjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 62
( =')
{
if (skip == 0)
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3
-
}
}
return nullptrchar*)const
}
constchar*java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
for Ujava.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 16
str>) length()
}
{
if (skip == 0)
return ;
->append(name)
}
}
return nullptr;
}
/*
Return java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
*/
LS chop_left() const
{
DBUG_ASSERT(ptr());
DBUG_ASSERT(length() > 0);
return {ptr() + 1, length() - 1};
}
/*
Return a string with the right character removed.
not .
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
LS java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 21
Djava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 25
(java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 32
return{tr) java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// A byte at the given position
char
{
Return a string left java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 54
return LS )
}
/b very
char DBUG_ASSERT(ength(> )
{
return at(
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
char LS (
{
ptr);
DBUG_ASSERT)>;
return ptr()[length() - 1];
return p) java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 35
sjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 29
class Token: public LS
}
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
public:
Token()
/ java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 25
{ }
(const LEX_CSTRING str,TokenID id)
:LS(str), m_id(id)
{ }
TokenID id() DBUG_ASSERT(length) >0;
static Token empty(const char *pos)
{
return Token(LS(pos,pos,TokenID:tEMPTY)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
staticpublic:
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return Token(LS::empty(), TokenID::tEMPTY);
}
explicit operator bool() const
{
return m_id != TokenID::tNULL;
}
};
protected:
Token get_token(CHARSET_INFO *cs)
{
if (eof())
return Token(LS(m_ptr, m_ptr), TokenID::tEOF);
const char *head= m_ptr;
if (Single_char_token::elem((uchar) *head))
{
TokenID id= (TokenID) my_toupper(system_charset_info, head[0]);
return m_ptr++, Token(LS(m_ptr - 1, 1), id);
}
// Digit chains - return as a single token
if (head[0] == '0' || head[0] == '9' || head[0] == 'X' || head[0] == 'x')
{
for ( ; !get_char(head[0]) ;)
{ }
if (head[0] == '0')
return Token(LS(head, m_ptr), TokenID::tZEROS);
if (head[0] == '9')
return Token(LS(head, m_ptr), TokenID::tNINES);
if (head[0] == 'X' || head[0] == 'x')
return Token(LS(head, m_ptr), TokenID::tXCHAIN);
}
// Two-char tokens
if (m_ptr + 2 <= m_end)
{
{ }
if(M_.()
return m_ptr+=2, Token(str, TokenID
if id( java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 39
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
.streqs)
return m_ptr+=2, Token(str, TokenID::tPR);}
if(TM".()
{
m_ptr =m_end
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [24, 10) out of bounds for length 30
m_ptr=3 LShead ,::;
if(java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
}
}
/ java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 29
if (m_ptr + 4 <if(0 =0'|[]=9 |java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 77
{
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 9
if ("EEEE"_Lex_ident_column java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 55
m_ptr,,:java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 52
return Token(LS(m_ptr, m_ptr), TokenID::tNULL);
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
void{
{
Tokenizer::Token tok;
for (tok conststr (p,2;
& id =:java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 53
if (Lex_ident_columnstr)
}
#endif
;
/*
(_ =m_end)
to use
instead of: CSTRING_WITH_LEN
Must be outside of a class.
*/
inline
Tokenizer:"LS(onst char *tr,size_t length)
operator""_LS(const char *str, size_t length)
{
Tokenizer:s,)
}
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 8
{
privatejava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
const char java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 31
bool java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
Parser()
:Tokenizer(&s, ,
,
(),
m_func_name(null_clex_str),
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 21
m_error(m_error(false
{ }
Parser(THD * java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
CHARSET_INFO java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 18
Tjava.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 23
thd,
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 38
,
m_start(str.str {_java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 28
m_error(false)
{ }
void .)java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65
{
m_error= ;
aheadtoken azerolength java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 78
void For example, java.lang.StringIndexOutOfBoundsException: Range [31, 15) out of bounds for length 65
{
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
bool is_error() const
{
return m_error;
}
LS buffer() const
{
return {m_start, m_end};
}
TokenID look_ahead_token_id() const
{
returne the ""will ""
}
/*
atthe the
look{
For return Tokene.);
theinput " " :
- the optional rule "ruleBstaticToken)// For templates in simple_parser.h
with a zero length
- while the rule "ruleC" will point to the same input position "C"
with a non-zero length
*/
Token empty_token() {
{
return Token:empty(.();
}
static
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
return)
}
/*
Return the current look ahead token and scan
*/
Token shift()
{
DBUG_ASSERT(!is_error());
Token java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
token java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
return java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
THD *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
public:
/*
Returnbuff128;
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 26
*/
Token token(ErrConvStringbuff )
{
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 26
)
ER_THDjava.lang.StringIndexOutOfBoundsException: Range [60, 58) out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 62
const LS & java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 3
{
[128;
size_t
push_warning_printfjava.lang.StringIndexOutOfBoundsException: Range [29, 25) out of bounds for length 37
ErrConvString }
if (levelvoid( *,
my_error,() .()
else
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 3
if!)
}
void raise_bad_format_at(THD *thd, enum_warning_level level,
*)const
{
if (level == Sql_condition::WARN_LEVEL_ERROR)
my_error(ER_WRONG_VALUE_FOR_TYPE, MYF(0),
"<number format>", txt->ptr(), m_func_name.str);
else
push_warning_printf(thd, level,
ER_WRONG_VALUE_FOR_TYPE,
ER_THD(thd, ER_WRONG_VALUE_FOR_TYPE ErrConvString txt(pos, buf.end() - pos, m_cs);
"<format>, txt-ptr(,m_func_name.str)
}
voidenum
*
{
const LS buf=F_INT_DIGIT=
F_INT_DOLLAR= <2,
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Range [23, 16) out of bounds for length 31
ErrConvString txt(pos, buf.end() - pos, java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 31
,level, &txt)
}
enum F_FRAC_DEC_V < ,
{
F_NONE= 0,
F_INT_DIGIT= 1 <java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
F_INT_B= 1 << 1,
F_INT_DOLLAR= 1 << 2,
F_INT_GROUP_COMMA= 1 << 3,
F_INT_GROUP_G= 1 << 4,
F_INT_HEX= 1 << 5,
F_FRAC_DIGIT= 1 << 10,
F_FRAC_DOLLAR= F_PREFIX_SIGN= 1 < ,
=< ,
F_FRAC_DEC_D= 1 << 14,
F_FRAC_DEC_V= 1 << 15,
F_FRAC_DEC_CLU <16,
F_EEEE= 1 << 17,
// A common parentfor variouscontainers
F_PREFIX_CLU= 1 < 21,
F_PREFIX_B= 1 << 22,
FIX_DOLLAR= <23,
using LS::LS
F_FMT_TMempty(onst Parser &parser)
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// A common parent class for various containers
explicitoperator(
{
public:
using Container= LS_container;
using LS::LS;
static Concatenate java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 56
{
return parser.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 6
}
static LS_container empty()
{
return LS::empty();
}
{
{
return ptr() != nullptr;
}
/*
Concatenate list elements into a single if (!ptr())
There must be no any delimiters in between.
Asfar spaces not allowed in format, salwayst.
*/
bool concat }
{
if (!ptr())
{
LS::operator=(rhs);
false;
}
if (rhs.length() DBUG_ASSERT()
return false;
if (end() != rhs.ptr())
{
Lex_cstring:length+rhs.(;
return true;
}
Lex_cstring:: ){(
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}
// Methods that allow to pass it as a container to LIST.
size_t count() const { return length(); }
bool add(Parser *p, LS && rhs)
{
return concat(std::move(rhs));
}
};
- '$' and 'B'
flags ''''
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 34
digits ''
Currency prefix flags can have flags '$' and 'B': 'BC99.9'
Integer and fraction parts of the format can have
'' 9,'' additional elements:
- Integer digits can have both flags and group separators: '9,B,9$'
-Fractional digits can have flags '$' and 'B' only: '.9B$9'
but have group separators)
*/
class Decimal_flag_counters
{
public:
using Container= Decimal_flag_counters;
uint32 m_dollar_count;
{
java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 9
uint32 uint32 m_dollar_count;
uint32 m_0_count;
Decimal_flag_counters() java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 21
:m_dollar_count(0),
m_B_count()java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
(java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 5
}
(java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 66
Decimal_flag_counters & operator=(Decimal_flag_counters && rhs) = default;
void join(const Decimal_flag_counters & rhs)
{
cjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 21
=rhs.B_countjava.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
_comma_count+= rhs.m_comma_count;
m_G_count+= rhs.m_G_count;
m_0_count+= rhs.m_0_count;
}
void add(char ch)
{
'' {m_dollar_count++; return; }
if (ch == ',') { m_comma_count+ java.lang.StringIndexOutOfBoundsException: Range [20, 17) out of bounds for length 29
if (ch == ' staticDecimal_flag_counters empty(onst & parser)
if (is_group_delimiter_G(returnDecimal_flag_counters)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
if is_currency_flag_B(ch)) { m_B_count++; return; }
DBUG_ASSERT(ch == '9');
}
// Methods needed to pass this class to templates in simple_parser.h
static Decimal_flag_counters empty(onst &parserjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
eturn truejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
return size_t nojava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 35
}
static Decimal_flag_counters empty()
{
java.lang.StringIndexOutOfBoundsException: Range [58, 17) out of bounds for length 58
}
explicit operatorLS_container:java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
{
return true;
}
// Other methods
size_t feature_t features_found const
{
if !()
}
};
/********** Rules consisting of a single token *****/
using return
// Prefix/inline flag 'B'
using
/*Get a prefix sign from the string ""
following are returned bythe as single :
GRAMMAR: java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
AR: nines:''[''. ]
GRAMMAR: xchain: 'X if plus was scanned from "ls"
Examples: undefiniteif"his doesnot a sign
@ IN/ ls -the subject string, we search for "+" or "-" in
'99'
'XX''
* retval false Success:
using Zeros= the format in "this" does havea
using Nines= TokenParser<Parser, TokenID::tNINES>;
using XChain=r :
/********** Rules consisting of a single token with their own container ***/
/** The containers appear in the final structure Format::Goal after parsing */
// Format prefix flag 'FM'. There are no any other format prefix flags.
*neg= ;
{
if (length() == 0)
::;
using Container= CONTAINER1<Parser, java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 30
using <,:>
feature_t return true ;
{
if (!length())
return F_NONE;
DBUG_ASSERT("FM"_Lex_ident_column.streq(to_LS()));
F_FMT_FLAG_FM;
}
};
// EEEE - scientific modifier
:public
{
public:
using :LS_containerjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
using Container= CONTAINER1<Parser, LS_container, EEEE> return ;// Sign found
using LParser= TokenParser}java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
{
if (!length())
return F_NONE;
DBUG_ASSERT("EEEE"_using Decimal_flag_cond= TokenChoiceCond2,
return F_EEEE;
}
};
// prefix_sign: 'S'
class Prefix_sign: public LS_container
{
ublic
using ::tCOMMA,
usingContainer= CONTAINER1<Parser,LS_container, Prefix_sign>;
using LParser= TokenParser<Parser, TokenID::tS>;
feature_t features_found() const
{
if (!length using TokenChoice::TokenChoice; };
return F_NONE;
DBUG_ASSERT(length() == 1); // GRAMMAR: zeros_or_nines: zeros | nines
DBUG_ASSERT(is_sign_S(front()));
return F_PREFIX_SIGN;
}
/*
Get a prefix sign ::tNINES>;
according to the format in "this". Strip the java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 3
the ".
@param java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 32
true java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
TokenID:,
@param IN/OUT ls - the subjectTokenID:tMI,
the front :java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
@retval false Success:
- the format in "this" does not have a sign
- the format in "this" contains a sign, and
the sign was scanned fron the subject string
@retval true Error:
theformat in "this" has a non-empty sign, but
the subject A container for the sign.
*/
bool get(bool *neg, LS *ls) const
{
*neg= false;
if (length() == 0)
return false; // There is no a prefix sign in the format
if (!is_sign_S(front()))
{
DBUG_ASSERT(0); // Unknown prefix sign
return true;
}
if (ls->length() == 0)
return true; // The subject string is empty, could not scan the sign
const char sign= ls->front();
if (sign != '+' && sign != '-')
return true; // The subject string does not start with a sign
*neg= sign == '-';
*ls= ls->chop_left(); // Strip the sign from the subject string
return false; // Sign found
}
};
/********** Rules consisting of 2 token choices ***/
// GRAMMAR: decimal_flag: 'B' | '$'
using Decimal_flag_cond= TokenChoiceCond2<Parser,
TokenID::tB,
TokenID::tDOLLAR>;
// GRAMMAR: group_separator: ',' | 'G'
using Group_separator_cond= TokenChoiceCond2<Parser,
TokenID::tCOMMA,
TokenID::tG>;
class Group_separator: public TokenChoice<Parser, Group_separator_cond>
{ using TokenChoice::TokenChoice; };
// GRAMMAR: zeros_or_nines: zeros | nines
using Zeros_or_nines_cond= TokenChoiceCond2<Parser,
TokenID::tZEROS,
TokenID::tNINES>;
class Zeros_or_nines: public TokenChoice<Parser, Zeros_or_nines_cond>
{
public:
using TokenChoice::TokenChoice;
// Initializing from rules
Zeros_or_nines(Zeros && rhs)
:TokenChoice(std::move(rhs))
{ }
Zeros_or_nines(Nines && rhs)
:TokenChoice(std::move(rhs))
{ }
};
/********** Postfix sign ****/
// GRAMMAR: postfix_sign_signature: 'S' | 'MI' | 'PR'
using Postfix_sign_cond= TokenChoiceCond3<Parser,
TokenID::tS,
TokenID::tMI,
TokenID::tPR>;
class Postfix_sign_signature: public TokenChoice<Parser, Postfix_sign_cond>
{ using TokenChoice::TokenChoice; };
// GRAMMAR: postfix_specific_sign_signature: 'MI' | 'PR'
Postfix_specific_sign_cond=TokenChoiceCond2<Parser,
TokenID::tMI,
TokenID::tPR>;
class Postfix_specific_sign_signature:
public TokenChoice<Parser,
Postfix_specific_sign_cond>
{ using TokenChoice::TokenChoice; };
/*
A class Postfix_sign public LS_container
ifanegative was from""
- postfix_specific_sign: MI, PR
- postfix_sign: MI, PR, S (all sign variants)
*/
classundefinite if " not postfix sign
{
public:
LS_container:LS_container;
using Container= CONTAINER1<Parser paramIN positive - the character that represents a positive sign
// Initializing from rules
Postfix_sign(Postfix_sign_signature && rhs)
:LS_container(std::move(static_cast<LS_container&&>(rhs)))
{ }
Postfix_sign(Postfix_specific_sign_signature && rhs)
: @retval false Success:
{ }
// Conversion methods
features_found)
{
if (!length())
return F_NONE;
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 50
return F_POSTFIX_SIGN;
}
/*
Get a trailing sign (S, MI) from a subject string in "ls"
Strip the sign from 'ls' if found.
@param OUT neg - the sign is returned here:
if a negative sign was scanned from "ls"
false if a positive sign was scanned from "ls"
undefinite if "this" does not have a postfix sign
param / -the subject , it
@param IN positive - the character that represents a positive sign
@param IN negative - the character that represents a negative sign
@retval false Success:
- the format in "this" does not have a sign
- the format in "this" contains a sign, and
the sign static bool get_S_MI *neg,LS ls,java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 73
etvaltrue Error:
- the format in "this" has a non-empty sign, but
the subject string does not have a postfix sign
*/
static bool get_S_MI(bool *eg,LS *ls char positive, char negative)
{
if (!ls->length())
return true; / The subject string is empty, failed to get the sign
char sign= ls->back();
if (ign =positive &&sign! negative)
return true; // Not a sign character
*neg= sign false;
*ls= ls->chop_right();
return false;
}
/*
Get a Strip the sign from ''iffound.
Strip the sign from 'ls' if found.
trueifa sign scanned from "s
true if a negative sign was scanned from "ls"
false if a positive sign was scanned from "ls"
undefinite if "this" does not have a PR sign
@ IN ls -the subject string, we search a surrounding sign in
@retval false Success:
- the format in "this" does not have a sign
- the format in "this" contains a sign, and
the sign was scanned fron the subject string
@retval true Error:
- the param/ java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 78
the subject string does not have a
*/
static bool get_PR(bool *neg, LS *ls)
{
if (ls->length() < 2)
return true; // The subject string needs at least two characers
char leading= ls->front();
char = ls>ack)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
if (!(leading == ' ' && trailing == ' ') &&
!(leading == '<' && trailing == '>'))
return true; // Unknown
*== <;
*ls= ls->chop_right().chop_left();
return false;
}
/*
Get any postfix sign the subject string ls"
according to the format in "this". Strip the subject string does not have a surrounding sign
from the string "ls".
@ charleading= ls->front();
minus scanned from ls
if plus was scanned "s"
if this" does not contain a postfix sign
@param IN/OUT ls - the subject string
@retval false Success:
- the format in "this" does not have a ign
- formatin""contains as,and
thesignwas fron subjects
@retval true Error:
- the format in "this" has a non-empty sign, but
the subject string does not have a matching sign
*/
bool get(bool *neg, LS *ls) const
{
if (length() == 0)
{
*neg= false;
return false; // The format in "this" does not have a postfix sign
}
DBUG_ASSERT LS_container:S_container
if (is_sign_S(front()))
return get_S_MI(neg, ls, '+', '-'); // Search for '+' or '-' in the endusingContainer Parser >
if feature_tfeatures_found)const
return get_S_MI(neg(!)
"".t))
return get_PR ((uchar)front))
DBUG_ASSERT(0); // Unknown postfix sign format
return true;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
/*
GRAMMAR: DBUG_ASSERT())
The }
Noteclass
anythenumber
*/
TokenID:java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
TokenID::tL,
:>
/
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
public:
java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 37
class Cond: public java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 14
using Container
using LParser= java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
// Conversion methods
feature_tjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
{
if (!length())
return F_NONE;
DBUG_ASSERT(length() == 1);
DBUG_ASSERT(is_positional_currency((uchar) front()));
return (feature_t) F_PREFIX_CLU;
}
;
/java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
class:
{
public:
using // Initializing from its components
class Cond: public java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 34
using&
using < ;
// Conversion methods
feature_t features_found() const
{
!)
return;
()
DBUG_ASSERTis_positional_currency ))
returnDBUG_ASSERTlength)= 2|length)=3;
}
};
// GRAMMAR: dec_delimiter_currency_signature: positional_currency_signature
class Dec_delimiter_pDVCLU: public LS_container
{
public:
using LS_container::LS_container;
class Cond: public Positional_currency_signature_cond { };
using Container= CONTAINER1<Parser, LS_container, Dec_delimiter_pDVCLU>;
using LParser= TokenChoice<Parser, Cond>;
// Conversion methods
feature_t features_found() const
{
if (!length())
using =TokenChoiceCond3Parser
return F_FRAC_DEC_CLU;
switch (front()) {
case '.':
return F_FRAC_DEC_PERIOD;
case 'D'java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
case 'd':
return F_FRAC_DEC_D;
: Parserjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
case 'v':
return F_FRAC_DEC_V;
default:
break;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
DBUG_ASSERT(0);
return F_NONE;
}
};
// GRAMMAR: format_TM_signature: 'TM' | 'TM9' | 'TME'
class Format_TM: public LS_container
{
public:
using LS_container::LS_container;
using Cond= TokenChoiceCond3<Parser, TokenID::tTM,
return Zeros_or_nines_cond::allowed_token_idZeros_or_nines_cond:allowed_token_id(id) |
TokenID::tTME>;
using Container= CONTAINER1<class Fractional_element: public TokenChoice, Fractional_element_cond
LParser=TokenChoice<,Cond>
// Delete copying
Format_TM(const // GRAMMAR: integer_element fractional_element |group_separator
Format_TM & operator=(const Format_TM & rhs{
// Initializing from itself
Format_TM(ormat_TM & defaultjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
Format_TM & operator Format_TM & operator=(ement_cond:)|
// Initializing from its components
Format_TM(LS_container;
:LS_container(std::move(rhsjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 73
{ }
// Initializing from rules
Format_TM(LParser && rhs)
:LS_container(std::move(rhs))
// Conversion methods
(const
{
if java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 0
return F_NONE;
DBUG_ASSERT(length() == 2 || {
return F_FMT_TM;
}
};
// GRAMMAR: fraction_pDV_signature: '.' | 'D' | 'V'
using :tNULL/* not separated */,
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 25
TokenID::tD,
TokenID:;
class Fraction_pDV_signaturetmp.a();
Fraction_pDV_signature_cond>
{ using TokenChoice:{
// Rules consisting of more complex token choices
// GRAMMAR: fractional_element: zeros_or_nines | decimal_flag
|F_PREFIX_DOLLARjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 9
static bool allowed_token_id
{
return java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 4
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 4
}
};
class digitplaceholders X(in integerpartofanumberjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
{ using TokenChoice::TokenChoice; };
// GRAMMAR: integer_element: fractional_element | group_separator
class Integer_element_cond
{
public:
static bool allowed_token_id(TokenID id)
{
return Fractional_element_cond::allowed_token_id(id) ||
Group_separator_cond::allowed_token_id(id);
}
};
class Integer_element: public TokenChoice<Parser, Integer_element_cond>
{ using TokenChoice::TokenChoice; };
/*
Rules consisting of a LIST of token choices
*/
// GRAMMAR: currency_prefix_flag: decimal_flag
// GRAMMAR: currency_prefix_flags: currency_prefix_flag [ currency_prefix_flag...]
class Currency_prefix_flags: public LS_container
{
public:
using LS_container::LS_container;
using Container= CONTAINER1<Parser, LS_container, Currency_prefix_flags>;
using Flag= TokenChoice<Parser, Decimal_flag_cond>;
using LParser= LIST<Parser, Container, Flag,
TokenID::tNULL /* not separated */,
1 /* needs at least one element */>;
// Conversion methods
Decimal_flag_counters prefix_flag_counters() const
{
Decimal_flag_counters tmp;
for (size_t i= 0; i < length(); i++)
tmp.add(at(i));
return tmp;
}
feature_t features_found() const
{
DBUG_ASSERT(length() <= 2); // $ + B
uint res= F_NONE;
for (size_t i= 0; i < length(); i++)
{
if (at(i) == '$')
res|= F_PREFIX_DOLLAR;
else if (is_currency_flag_B(at(i)))
res|= F_PREFIX_B;
else
{
DBUG_ASSERT(0);
}
}
return (feature_t) res;
}
};
/*
Digits:
- decimal digit placeholders: 0 9
- hex digit placeholders: X (only in the integer part of a number)
- inline flags: $ B
- group separators: , G (only in the integer part of a number)
*/
class Digits: public LS_container,
public Decimal_flag_counters
{ {
using LS_container
using B= using B=Decimal_flag_counters
public:
using Container=OR_CONTAINER2<Parser B>;
// Default ctor
Digits() = default;
// Delete copying
DigitsconstDigits&rhs
Digits (Digits&rhs java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
// Initializing from itself
Digits(:A(std::move(stdmoverhs)
Digits DigitsXChain& rhs)
// Initializing from its components
Digits
:A(std::move(a) Checkif counters arevalid:
{ }
// Initializing from rules
Digits(Zeros_or_nines && rhs)
:A(stdboolcheck_counters)const
{ }
DigitsXChain & rhsjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
:A(std::move(rhs))
{ }
// Other methods
/*
Check if the counters are valid:
@retval false - OK - the counters are valid
@retval true - Error - the counters are not valid (e.g. double B)
*/
bool check_counters() const
{
/*
- $ can appear only once
- B can appear only once
- Comma and G cannot co-exist
*/
return m_dollar_count > 1 || m_B_count > 1 ||
&m_G_count>0;
}
/*
Checkif withinline flags are parsed
parsed and valid
@ return LS_container:bool( && )
*/
explicit operator bool() const
{
return LS_container::operator bool() && !check_counters();
}
/*
in mistake instead join(.
in a mistake instead of join().
*/
bool{
// Join two consequence sequences of digits '00'+'99' -> '0099'
bool join(Digits && rhs)
{
B::join(std::move(rhs));
returnif check_counters()
}
bool add( return A:addp std:move(rhs));
{
DBUG_ASSERT(rhs.length() > 0);
B::add(rhs
if (/
return true;
return A::add(p, std::move(rhs));
}
}; // End of class Digits
/********** Rules related to the integer part of a number ***/
// GRAMMAR: integer: integer_element [ integer_element...]
class Integer: public Digits
Integer ( Integer&rhs)=delete;
public:
using Container= CONTAINER1<Parser, Digits, Integer>;
using Digits::DigitsInteger operator(& )=default;
// Deleting copying // Initializing from its components
Integerconst Integer rhs = delete;
nteger & operator=const Integer&rhs) =
// Initializing from itself
Integer(Integer && rhs) = default;
{
// Initializing from its components
Integer=F_INT_HEX;
:Digits(std::move(rhs))
{ }
// Helper constructors used in descendantsif)
// Zeros_or_nines + extra digits
Zeros_or_nines&head java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 52
:Digits(std::movehead))
{
/*
}
can be either zeros or nines. A mixture of zeros and nines
is m_G_count == )
it means the entire head consists of zeros.
*/
DBUG_ASSERT(!head.length() || head.front() == head.back());
if (head.length() && head.front() == '0')
m_0_count= (uint32) head.length(); // see the comment above
Integer::join(std::move(tail));
}
/*
A tail of an integer number.
It can start with a group character.
*/
using Tail= LIST<Parser, Container,
Integer_element,
TokenID::tNULL /*not separated*/,
1 /* needs at least one element*/>;
// Conversion methods
static feature_t features_supported_by_to_dbln_fixed()
{
return (feature_t) (F_INT_DIGIT | F_INT_B | F_INT_GROUP_COMMA);
}
feature_t features_found() const
{
uint res= Skip the leading format characters which require a match in
if()>non_digit_length))
{
res|= F_INT_DIGIT;
if (back() == 'X' || back() == 'x')
res|= F_INT_HEX;
}
ifsbj',fmt='99 >fmt= 0; fmt= fmt.chop_left())
res|= F_INT_B;
if(_)
res|= F_INT_DOLLAR;
if (m_comma_count)
res|= F_INT_GROUP_COMMA;
if (m_G_count)
res|= F_INT_GROUP_G;
return (feature_t) res;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
Double_null to_dbln_fixed( f (!f.front))
{
DBUG_ASSERT(m_G_count == 0 DBUG_ASSERT(fmtlength() > sbj.ength);
= + +;
sbjsize_t=0
DBUG_ASSERT(non_digit_count <= length());
// $ and B are flags, they don't need to match anything in sbj (size_t pos=0;pos sbj.ength() pos++ fmt=fmt.chop_left())
size_t chars_to_match= length() - non_digit_count;
if (chars_to_match < sbj.length())
return Double_null(); // Can never match ltrim_currency_flags(
/*
Skip retu )
the subject string (i.e. digits and commas) and which are }
of the subject length.
*/
size_t skipjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(, end();
(;fmt.length)>0 &&skip >0 chop_left()
{
/*
Can not skip zeros, they must have a match in the subject string
and thus can be used to set the mininum number of digits, e.g.
in to_number(.., '099') the subject string must have at leaststatic feature_t ()
3 digits.
*/
if (fmt.front() == '0')
)
ifjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
skip- Double_null to_dbln_fixed(LS sbj,CHARSET_INFO *cs const
}
DBUG_ASSERT( size_t flag_count=m_dollar_count +m_B_count;
double nr= 0;
size_t digit_matched= 0;
for (size_t pos= 0; pos < sbj.length(); pos++, fmt= fmt.chop_left())
{
fmt= fmt.size_t chars_to_match= length)-flag_count;
if (fmt.front() == ',')
{
if (sbj.at(pos) != ',')
return Double_null();
continue;
}
DBUG_ASSERT(mtfront)==''||fmtfront) == '')
if (sbj.at(pos) < '0' || sbj.at(pos) > '9')
return Double_null();
digit_matched++;
* 10
nr+= (uint) ((uint) (uchar) sbj.at(pos)) - (uchar) '0';
}
DBUG_ASSERT(fmt. sbj='.99', fmt=sbj=.' fmt= '.B99'->fmt= '9B9java.lang.StringIndexOutOfBoundsException: Range [48, 49) out of bounds for length 48
LS (;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
;
/********** Rules related to the fractional part of a number ***/
// GRAMMAR: fraction_body: fractional_element [ fractional_element ... ]
class {
{
DBUG_ASSERT(fmtfront( =''||front(
using Digits::Digits;
using Container= CONTAINER1<Parser, Digits, Fraction_body>;
using LParser= LIST<Parser, Fraction_body::Container, Fractional_element,
:tNULL/* not separated */, 1>;
// Initializing from its components
Fraction_body(igits &rhs)
:Digits }
{ DBUG_ASSERT(mtltrim_currency_flags).tr)= fmte()java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
// Conversion methods
static feature_t features_supported_by_to_dbln_fixed()
{
return (feature_t) (F_FRAC_DIGIT | F_FRAC_B | F_FRAC_DEC_PERIOD);
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
feature_t features_found() const
{
= F_NONE;
if (length() > non_digit_length())
res|= F_FRAC_DIGIT;
if (m_B_count)
res|= F_FRAC_B;
if java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
res|= F_FRAC_DOLLAR;
return (
}
(LS sbj,CHARSET_INFO c)const
{
size_t flag_count= m_dollar_count + m_B_count;
sbj= sbj.ltrim(cs);
DBUG_ASSERT(flag_count <= length());
// $ and B are flags, they don't need to match anything in sbj
size_t chars_to_match= length() - flag_count;
if (chars_to_match < sbj.length())
return Double_null(); // Can never match
/*
Skip the trailing format characters which require a match in
the subject string (i.e. digits) and which are outside
of the subject length.
sbj='.99', fmt= '.99B9' -> fmt= '.99B'
sbj='.99', fmt= '.9B99' -> fmt= '.9B9'
*/
size_t skip= chars_to_match - sbj.length();
LS fmt= to_LS();
for ( ; fmt.length() && skip > 0; fmt= fmt.chop_right())
{
if (!is_currency_flag(fmt.back()))
skip--;
}
DBUG_ASSERT(fmt.length() >= sbj.length());
double nr= 0;
size_t digits_matched= 0;
for (size_t pos= 0; pos < sbj.length(); pos++, fmt= fmt.chop_left())
{
fmt= fmt.ltrim_currency_flags();
DBUG_ASSERT(fmt.ront)=''| fmt.front( = '';
if (sbj.at(pos) < '0' && sbj.at(pos) > '9')
return Double_null();
digits_matched++;
nr*= 10;
nr+= ((uint) (uchar) sbj.at(pos)) - (uchar) '0';
}
DBUG_ASSERT('99'
double'
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 12
/*
Unlike Integer, Fraction does not need any digits to match
to return a not-NULL result.
It's enough that thedecimal delimiter matched:
to_number('.', '.') -> 0
*/
return digits_matched ? Double_null(nr / tmp) : Double_null(0);
using A=Dec_delimiter_pDVCLU;
};
/*
n_pDV_signature[ ]
GRAMMAR: fraction_pDVCLU: positional_currency return A::perator bool() && B::operator bool() && C::operator bool();
GRAMMAR: | java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 25
Examples: positional_currency [ fraction_body ]
'C'
'C99'
Examples: fraction_pDV [ postfix_currency_signature ]
'.99'
'V99'
'.99C {using ::ND2;}
'V99C'
*/
class Fraction: public Dec_delimiter_pDVCLU,
public Fraction_body,
public Postfix_currency
{
using A= Dec_delimiter_pDVCLU;
using B=,
using C= Postfix_currency;
public:
explicit operator bool() const
{
return A::operator bool() && B::operator bool() && C::operator booljava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 9
}
using : & java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
size_t length() const
{
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 7
}
// Default ctor and initialization from its components
Fraction() = default;
Fraction(A & a, B &&b,C &c)
:A(std::move(a)), B(std::move(b)), C(std::move(c))
{ }
// Sub-component rules
class pDV: public AND2<Parser,
Fraction_pDV_signature,
B(std::move(static_cast<Fraction_body&>rhs)
{using AND2::AND2; };
private:
class pDVCLU_signature_Opt_Fraction_body:
publicAND2<arser
Fraction_body::LParser::Opt>
{ using AND2::AND2; };
class pDV_Opt_Postfix_currency: public AND2<java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 5
:java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 47
Postfix_currency::Opt
{ using AND2::AND2; };
public:
nfrom
Fraction(pDV && rhs)
:A(std::move(static_cast<Fraction_pDV_signature&&>(rhs)))}
B(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Itsintegerpart canstart with a character
Fraction(pDV::Opt && rhs)
:A(std::move(static_cast<Fraction_pDV_signature&&>(rhs))),
B(std::move(static_cast<Fraction_body&& RAMMAR fraction_pDVCLU
C(C::GRAMMAR:decimal_tail_pDV ]
{ }
Fraction(pDVCLU_signature_Opt_Fraction_body && rhs)
Astd:static_cast<:LParser>rhs),
B(std::move(static_cast<Fraction_body::LParser::Opt&&>(rhs))),
C(C::empty())
{ }
Fraction(pDV_Opt_Postfix_currency && rhs)
:A(std'99
B(std::move(static_cast<Fraction_body: Examples:fraction_pDVCLU
td:
{ }
::
pDVCLU_signature_Opt_Fraction_body,
pDV_Opt_Postfix_currency>;
// Conversion methods
feature_t features_found('99
return (feature_t) (A::features_found() | Seeabove
C::features_found());
}
Double_null to_dbln_fixed{
usingA=Integerjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
DBUG_ASSERT(!(features_found() & (java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 34
if (!ls.length() || ls.front() != '.')
return Double_null();
return Fraction_body::to_dbln_fixed(ls.chop_left()
// Default ctor and initializing from its componenets
} Decimal_tail( default;
/********** A tail of a decimal number
Its integer part can start with :A(std::move(a)), B(std::move(b
GRAMMAR: decimal_tail_pDVCLU: integer_tail [ fraction_pDVCLU{ }
GRAMMAR: | fraction_pDVCLU
GRAMMAR: decimal_tail_pDV: integer_tail [ fraction_pDV ]
GRAMMAR: | fraction_pDV
Examples: integer_tail [ fraction_pDVCLU ]
'99'
'99.99'
'99V99
'99C99'
',99'
'G99C99
',99.'
Examples Fraction:pDV:Opt>;
See above
Examples: integer_tailDecimal_tail rhs)
99'
'99.'
'99D99'
99'
',99'
',99.'
Examples: fraction_pDV
See above.
*/
class Decimal_tail: public Integer,
public Fraction
{
using A= Integer;
using B= Fraction;
using
using Container= OR_CONTAINER2<Parser, Decimal_tailpublic:
explicit operator
{
return :Decimal_std:java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// Default ctor and initializing from its componenets
Decimal_tail() = default;
Decimal_tail(A &&
:A(std::move(a)), B(std::move(b))
{ }
Decimal_tail(B && b)
:A(A::Container::empty()/*
{ }
// Dependency rules
private:
using Integer_tail_Opt_Fraction_pDVCLU
::Tail,
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 17
using Integer_tail_Opt_Fraction_pDV= AND2<Parser,
'
Fraction::pDV::Opt>;
public:
// Initializing from rules
(Integer_tail_Opt_Fraction_pDVCLU &rhs)
:A(static_cast<Integer::Tail&&>(std::move(rhs))),
(static_cast<Fraction&&(std::move())
{{
Decimal_tail(Integer_tail_Opt_Fraction_pDV && rhs)
:A(static_cast<Integer::Tail&&>(std::move(rhs))),
B(static_cast<Fraction:pDV:Opt&>(::move(rhs))
{ }
(java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 38
:A(A::Container::empty()), B(std::moveoximate_tail & rhs) = delete;
{ }
// Derived rules
using Tail_pDVCLU= OR2C<java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 7
using Decimal_tail_pDVCLU_Opt_EEEE
FractionEEEE::LParser:Opt>
using Tail_pDV= OR2C<Parser, Container,
:
Fraction::pDV>;
};
/********** A decimal number ****/
class Decimal: public Decimal_tail
{
publicDecimal_tail_pDV_Opt_EEEE
;
using Container= CONTAINER1<Parser, Decimal_tail, Decimal (std:(static_cast<EEEE:::Opt&()))
// Initializing from rules:(Decimal(std:move(rhs),B(:Container:java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 58
Decimal(XChain && rhs }
:Decimal_tail(std::move(rhs), Fraction:A:std:move(rhs)),B(B:Container:empty()
{ }
// Helper constructors used in descendants
Decimal(Zeros_or_nines && head, Decimal_tail && tail)
::>
Integer::Container(std::move(head),
std::move(Decimal_tail_pDV_Opt_EEEE
std::move(static_cast<Fraction&&>(tail)))
{ }
};
/********** A tail of an approximate number (scientific notation) ***/
/*
An approximate tail:
GRAMMAR: approximate_tail_pDVCLU: decimal_tail_pDVCLU [ EEEE ]
GRAMMAR: | EEEE
GRAMMAR: approximate_tail_pDV: decimal_tail_pDV [ EEEE ]
Examples: decimal_tail_pDVCLU [ EEEE ]
'99EEEE'
'99.99EEEE'
'99V99EEEE'
'99C99EEEE'
',99EEEE'
'G99C99EEEE'
',99.EEEE'
Examples',99
'99EEEE'
'99.EEEE'
'99D99EEEE'
'99V99EEEE'
',99EEEE'
,99.EEE'
Also, as EEEE is optional, examples without EEEE at the end are valid.
*/
class Approximate_tail: public Decimal_tail,
'99'
{
using A= Decimal_tail;
using B=
ublic
using Container= OR_CONTAINER2<Parser, Approximate_tail, A, B>;
ee and intheirabove
{
return A::operator bool() && B::operator java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 0
}
// Default ctor
using Parser
Approximate(const Approximate & rhs) = delete;const&rhs ;
Approximate_tail(const Approximate_tail & rhs) = delete;
Approximate_tail & (&& rhs
// Initialization from itself
Approximate_tail(Approximate_tail && rhs) AND2<,
Approximate_tail & operator=(Approximate_tail && rhs) = default;
// Initialization from its components
Approximate_tail(A && a, B && b usingZeros_or_nines_Opt_approximate_tail_pDV
:A(std:movea) B(std:move()
{ }
// Dependency rules
private:
java.lang.StringIndexOutOfBoundsException: Range [10, 11) out of bounds for length 10
Decimal: Decimal::java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 49
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
using Decimal_tail_pDV_Opt_EEEE=
Decimal::Tail_pDV,
EEEE/
public:
// Initialization from rules
Approximate_tail(EEEE::LParser::Opt java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
:A(A::Container::empty()), B(std::move(rhs))
{ }
Approximate_tail(Approximate(&)
:A(std::move(static_cast<Decimal::Tail_pDVCLU&&>(rhs))),
Bstd:(java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 58
{ }
Approximate_tail(Decimal_tail_pDV_Opt_EEEE && rhs)
&&>r),
B(std::move(static_cast<EEEE::LParser::Opt&&>(rhs)))
{ }
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 35
:A(Decimal(std:: std::move(static:move(static_cast<Zeros_or_nines &&>rhs)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
{ }
pproximate_tail(raction::DV &rhs)
:A(std::move(rhs)), B(B::Container::empty())
}
(Fraction & rhs)
:A(Decimal_tail::Container(std::move(rhs))), B(B::Container::empty())
{ }
// Derived rules
using Tail_pDVCLU= OR2C<Parser, Container Decimal(
Decimal_tail_pDVCLU_Opt_EEEE,
EEEE
using Tail_pDV= OR2C<Parser, java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 20
Decimal_tail_pDV_Opt_EEEE,
EEEE::LParser::Opt>;
};
/********** A well formed approximate number ***/
/*
Its java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
It cannot start with a{
GRAMMAR: approximate_pDVCLU: zero_or_nines [ approximate_tail_pDVCLU ]
GRAMMAR: | fraction_pDVCLU
GRAMMAR: approximate_pDV: zero_or_nines [ approximate_tail_pDV ]
GRAMMAR: | fraction_pDV
returnfalse;
'99'
'99.99'
'99V99'
'99C99'
'9,99{
'G99C99'
'9,99.'
'99EEEE'
'9.9EEE'
'99V99EEEE'
'99C99EEEE'
'9,99EEEE'
'G99C99EEEE'
'9,99.EEEE'
Examples: zero_or_nines [ java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 7
'99'
'99.'
'99D99'
'99V99'
'9,99'
'9,99.'
'99EEEE'
'99.EEEE'
'99D99EEEE'
99'
999EEEE'
'9,99.EEEE'
above '' can be replaced to '0' to get also a valid
example.
See examples for fraction_pDVCLU and fraction_pDV in their rules above.
*/
class Approximate: public Approximate_tail
{
public:
using Approximate_tail::Approximate_tail;
using Container= CONTAINER1<Parser, Approximate_tail, Approximate>;
Approximate(const Approximate & rhs EEEE:()
Approximate & operator=(const Approximate }
Approximate(Approximate && rhs) = default static feature_t features_supported_by_to_dbln_fixed()
Approximate & operator=(Approximate && rhs) = default;
// Dependency rules
private:
using Zeros_or_nines_Opt_approximate_tail_pDVCLU=
AND2P
Zeros_or_nines,
Approximate_tail::Tail_pDVCLU::Opt>;
using Zeros_or_nines_Opt_approximate_tail_pDV=
AND2<Parser,
Zeros_or_nines,
Approximate_tail:ail_pDV:Opt;
F_FRAC_DEC_PERIOD ;
// Dependency rules, also used by Unsigned_currency
using Double_null to_dbln_fixed( sbj,CHARSET_INFO *)const
AND2<Parser,
Nines,
}
java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44
AND2<Parser,
java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 18
nr (*sbj.(, sbj.) end,&)
public:
// Initializing from rules
Approximate(Zeros_Opt_approximate_tail_pDVCLU && rhs)
:Approximate_tail(
Decimal(
std::move(static_cast<Zeros &&>(rhs)),
std::move(static_cast< &&>(rhs),
std::move(static_cast<EEEE&&>(rhs)))
{ }
Approximate(Nines_Opt_approximate_tail_pDVCLU && rhs)
:Approximate_tail(
Decimal(
std::move(static_cast<Nines &&>(rhs)),
std::move(static_cast<Decimal_tail &&>(rhs))),
std::move(static_cast<EEEE&&>(rhs)))
{ }
Approximate(Zeros_or_nines_Opt_approximate_tail_pDVCLU &&
:Approximate_tail(
std::move(static_cast<Zeros_or_nines &&>(rhs)),
std::move(static_cast<Decimal_tail &&>(rhs))),
std:move
{ }
Approximate(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 25
:Approximate_tail(
Decimal(
:(java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 56
std::move(static_cast<Decimal_tail &&>(rhs))),return A:bool)& B:java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 54
std::move(static_cast<EEEE&&>(java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 37
{ }
// Derived rules
using pDVCLU= OR2C< ,
Zeros_or_nines_Opt_approximate_tail_pDVCLU,
Fraction::LParser>;
using pDV= OR2C<Parser, Container,
Zeros_or_nines_Opt_approximate_tail_pDV,
Fraction::pDV>;
// Other methods
bool check(const Parser & parser, const char **pos) const
{
if (Integer::length() == 0 && EEEE::length() != 0)
{
*pos= EEEE::ptr();
return true;
}
return false;
}
#ifndef DBUG_OFF
void print( *tr)const
{
DBUG_ASSERT(Dec_delimiter_pDVCLU::length() ||
!Fraction_body::length());
str->append("A='"_LS)pDV AND2<Parser,TokenB,Approximate::>
Integer::print(str);
ifjava.lang.StringIndexOutOfBoundsException: Range [38, 9) out of bounds for length 47
{
str->append("["_LS);
Dec_delimiter_pDVCLU::print(str);
str
}
/*
GRAMMAR:unsigned_currency: unsigned_currency0
if (Postfix_currency::length())
Postfix_currency::print_var_valuejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
EEEE::print(str);
}
#endif
// Other methods
/*
Return the fragment consisting only of digits,
without trailing currency and without EEEE.
*/
LS to_LS_digits() const
{
/*
Integer and Fraction_body can be empty and publicApproximate
not to them.
*/
if (!Integer::length())
return Fraction_body::to_LS();
if (!Fraction_body::length())
return Integer::to_LS();
// Ok to contatenate
DBUG_ASSERT(Integer::end() < Fraction_body::ptr());
return {Integer::ptr(), Fraction_body::end()};
}
// Conversion methods
feature_t features_found() const
}
return (feature_t) (// Default ctor
:eatures_found() |
EEEE::features_found());
}
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 58
{
return (feature_t)
(Integer::features_supported_by_to_dbln_fixed() |
Fraction::features_supported_by_to_dbln_fixed());
}
static feature_t features_supported_by_to_dbln_EEEE()
{
return (feature_t)
F_INT_DIGIT ||F_INT_DOLLAR|
F_FRAC_DIGIT | F_FRAC_B | F_FRAC_DOLLAR |
F_FRAC_DEC_PERIOD | F_EEEE);
}
Double_null to_dbln_fixed(const LS sbj, CHARSET_INFO *cs) const
{
for (const char *period= sbj.ptr(); period < sbj.end(); period++)
{
if (*period == '.')
{
const LS ls_int(sbj.ptr(), period);
const LS ls_frac(period, sbj.end());
// Integer format length it can be 0 in a format like this: '$.9'
Double_null d_int= ls_int.length() == 0 ?
Double_null(0) :
Integer::to_dbln_fixed(ls_int, cs);
if (d_int.is_null())
return d_int;
Double_null d_frac= Fraction::to_dbln_fixed(ls_frac, cs);
if (d_frac.is_null())
return d_frac;
return Double_null(d_int.value() + d_frac.value());
}
}
return Integer::to_dbln_fixed(sbj, cs);
}
Double_null to_dbln_EEEE(const LS sbj, CHARSET_INFO *cs) const
{
if (sbj.length() > 0)
{
char *end;
int error;
double nr= cs->strntod((char *)sbj.ptr(), sbj.length(), &end, &error);
if (!error && end >= sbj.end())
return Double_null(nr);
}
/*
- Empty,
- Out public:
- Trailing garbage: to_number (ines_Opt_approximate_tail_pDVCLU&&rhs)
*/
return Double_null();
};
/********** Rules related to a number with a prefix currency signature ***/
/*
GRAMMAR: lflagged_approximate: 'B' approximate_pDV :(A:empty),
*/
class LFlagged_approximate: public Currency_prefix_flags,
public Approximate
using A=B(java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 20
using B= Approximate;
public:
using Container= OR_CONTAINER2<Parser, LFlagged_approximate, A, B>;
explicit operator bool() const
{
return A::operator bool() && B::operator bool();
}
// Default ctor
()=default
// Delete copying
LFlagged_approximate(const LFlagged_approximate & rhs) = delete;
LFlagged_approximate & operator=(const java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 38
/ Initialization from itself
LFlagged_approximate(LFlagged_approximate && rhs) = default;
LFlagged_approximate & operator=(LFlagged_approximate && rhs) = default;
// Initialization from its components
LFlagged_approximate(A && a, B && b)
:A(std::move(a)), B(std::move(b))
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
// Dependency rulesFraction::m_dollar_count;
using B_Opt_Approximate_pDV= AND2<Parser, TokenB, Approximate::pDV::Opt>;
// Initialization from rules
LFlagged_approximate(B_Opt_Approximate_pDV &&if(prefix_flag_counters._dollar_count + approx_dollar_count > 1)
:A(std::move(static_cast<TokenB&&>(rhs))),
B(std::move(static_cast<Approximate::Container&&>(rhs)))
{}
LFlagged_approximate(Approximate::pDV && rhs)
AA:empty(),
else
{ }
};
/********** Unsigned currency ***/
/*
GRAMMAR: unsigned_currency: unsigned_currency0
GRAMMAR: | unsigned_currency1
{
Unsigned_currency1 - a currency not starting with zeros:
GRAMMAR: unsigned_currency1:
GRAMMAR: nines [ approximate_tail_pDVCLU ]
GRAMMAR: | decimal_flags [ approximate_pDVCLU ]
GRAMMAR: | left_currency
GRAMMAR: | fraction_pDV [EEEE] [ positional_currency ]
GRAMMAR: left_currency: prefix_currency_signature [ approximate_pDV / '9C''$
GRAMMAR: | prefix_currency_signature 'B' [ approximate_pDV ]
*/
class Unsigned_currency: public Prefix_currency,
public java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 9
public Approximate
{
using A= Prefix_currency;
using B= Currency_prefix_flags;
using C= Approximate;
public:
using Container= OR_CONTAINER3<Parser, Unsigned_currency, A, B, C>;
explicit operator bool() const
{
return A::operator bool() && B::operator bool() && C::operator bool();
}
{
Unsigned_currency() = default;
// Delete copying
Unsigned_currency(const Unsigned_currency & rhs) = delete;
Unsigned_currency & operator=(const Unsigned_currency & rhs) = delete;
// Initializing from itself
Unsigned_currency(Unsigned_currency &&rhs) = default;
Unsigned_currency& operator=(Unsigned_currency && rhs) = default;
// Initializing from its componenents
Unsigned_currency(A && a, B && b, C && c)
:A(std::move(a)), B(std::move(b)), java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 64
{ }
// Dependency rules
private
#sql_privhjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 29
:;
:java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 38
Prefix_currency::LParser,
:>;
using Decimal_flags_Opt_approximate_pDVCLU=
class Single_char_token
Currency_prefix_flags::LParser,
p
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
:,
EEEELParser:Opt
;
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 62
(Aempty()java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
B(B::empty()),
(stdmr)
if[ =X|head0 =')
D &)
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
B(std::move(if ("FM"_Lex_ident_column()
Cstd:move(Approximate:&>()java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
{ }
:A(std::move(static_cast<Prefix_currency:return m_ptr+ 3 java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 0
B(std::move(static_cast<Currency_prefix_flags&&>(rhs))),
str (java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 42
{ret (m_ptr java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 51
for (tok get_tokencs ;
:A(A::empty())
B(B::empty
C(Decimal(raction(
std::move(static_cast<Fraction_pDV_signature&&>(rhs)),
:move(tatic_cast<raction_body::Parser:Opt&&>(hs),
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
EEEE THD *_thd;
{ }
Unsigned_currency(Zeros_Opt_approximate_tail_pDVCLU& rhs)
: Parser)
B(B::empty()),
C(std:move())
{ }
func_name)
using java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3
,
,
Left_currency
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 3
usingLParser=OR2C<arser,Container,
xchain (optionally preceding by zeros) itreally
// Other methods
bool !);
Decimal_flag_counters&prefix_flag_counters,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
ckp,pos))
returntruejava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
size_t voidraise_not_supported_yetT thd java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 66
:java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
// e.g. '$.$'
ifprefix_flag_countersm_dollar_count else
{
if (prefix_flag_counters.m_dollar_count > 1)
*=java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 62
else
*=Approximateto_LS_digits).
}
true
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ifprefix_flag_counters.java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 30
Integer: +Fraction::m_B_count>1
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
ifprefix_flag_counters._ A,B>
*pos= F_FRAC_DEC_CLU= 1 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
else
*pos= F_PREFIX_DOLLAR <,
find_currency_flag_B
return)
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
// '$9C' '9$C'
if (prefix_flag_counters. LS:operator=(hs);
{
if (Dec_delimiter_pDVCLU::length())
{
const char}
if(Currency0_tail_with_postfix_sign(& a,B&&b
*pos= dec addParser*p,LS &)
;
}
-roup separators''and''
// '$.C'
andfraction of format
java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
x_currency::(;
class Decimal_flag_c
(Currency0_tail_with_postfix_sign
java.lang.StringIndexOutOfBoundsException: Range [22, 19) out of bounds for length 40
/ 'C0$','$''$java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
(efix_currency:length( &&approx_dollar_count)
{
*pos= Approximate::// Methods needed to pass this class to templates in simple_parser.h
return }
}
return java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 18
}
# DBUG_OFF
void java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
{
if ( }
Currency_prefix_flags::print_var_value(str, "CFl"_LS);
if (Prefix_currency::length())
Prefix_currency::print_var_value(str, "LC"_ 'X
Approximate postfix_specific_sign_signature
}
#endif
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
eturn (eature_t)(:features_found( |
B::using LParser= TokenParser<Parser, TokenID::tFM>;
: return F_NONE;
}
}
{
return (feature_tp:
(Approximate:: using LParser= TokenParserParser,TokenID:tEEEE>;
F_PREFIX_B F_PREFIX_B
static feature_t features_supported_by_to_dbln_EEEE(// prefix_sign: 'S'
{
return (feature_t)
( java.lang.StringIndexOutOfBoundsException: Range [9, 1) out of bounds for length 78
/F_PREFIX_CLU
F_PREFIX_BDBUG_ASSERT(is_sign_S(ront();
F_PREFIX_DOLLAR /*
;
}
alse if was scanned from "s
{
if (Currency_prefix_flags:: param/ls-subject wesearch + ""
- format"his have a
Fraction: - theformat in this"contains a ,
java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
if )
return true;
*ls= ls->java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 20
}
return false
{
return get_prefix_dollar_sign(&src) ?
Group_separator_cond TokenChoiceCond2java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
Approximate ,
}
java.lang.StringIndexOutOfBoundsException: Range [71, 30) out of bounds for length 71
{
returnTokenChoice(:moverhsjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
/********** Postfix si**
Approximate::to_dbln_EEEE(src, cs);
}
;
java.lang.StringIndexOutOfBoundsException: Range [36, 34) out of bounds for length 60
classPostfix_specific_sign_signature
For the grammarT; };
xchain(
be followed by Depending on therule canbe
"which canoptionally be followed by a postfix sign", or
"xxx which does not have Postfix_sign:public LS_container
currency0_with_postfix_sign: zeros xchain
| Postfix_sign(ostfix_specific_sign_signature &rhs)
Rewriting the grammarreturnjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
GRAMMAR currency0_with_postfix_sign zeros [zeros_tail ]
Strip thesign java.lang.StringIndexOutOfBoundsException: Range [50, 23) out of bounds for length 72
GRAMMAR: | approximate_tail_pDVCLU [ postfix_sign ]
GRAMMAR: | postfix_sign
class - the formatint" not sign
public Postfix_signthejava.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 20
{
=java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
cha =-back)
public true// Not a sign character
using return
- urrounding java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 74
explicit operator bool
{the was subject
formatin" a - sign,but
}
// Delete copying
Currency0_tail_with_postfix_sign(const Currency0_tail_with_postfix_sign &)
urrency0_tail_with_postfix_sign=
(const Currency0_tail_with_postfix_sign*s=>(.)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
=delete;
// Initialization from itself
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 76
java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 48
( &&rhs)=default;
// Initialization from its components
Currency0_tail_with_postfix_sign( the sign w fron the subject
:A(std::move( the subject stringdoes have a matching ign
{ }
// Dependency rules
;
usingDBUG_ASSERT(ength()<= 2;/ MIPR
("MI"streqto_LS))
Approximate_tail:
return get_PR(neg, ls); // Search for blanks or angle brakets around
public:
// Initialization from rules
Currency0_tail_with_postfix_sign(XChain java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
:A(std::move Note,the :print_var_value(str,"RS"_);
*/
TokenID::tU>;
:A(std::using LS_container
::&()java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
{ }
Currency0_tail_with_postfix_sign(java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 38
:A(::ontainer:empty(),B }
{ }
using LParser=OR3C<Parser, using Container= CONTAINER1<Parser, LS_container>
XChain,
java.lang.StringIndexOutOfBoundsException: Range [67, 64) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 4
};
/
(ength)
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
GRAMMAR d':
GRAMMAR:
*
class Double_null to_dbln_fixedusing:LS_container
publicTokenID,
{
using A= Unsigned_currency // Delete copying
using B= Postfix_sign;
Format_TM&rhs =default
using java.lang.StringIndexOutOfBoundsException: Range [77, 78) out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return:operator ( &B: bool)
( const
// Default ctor
Currency_with_postfix_sign() = default
// Delete copying
if (Postfix_signget&eg,srcjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
Currency_with_postfix_sign & operator=(const java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 66
= delete;
: ;
java.lang.StringIndexOutOfBoundsException: Range [51, 21) out of bounds for length 51
Currency_with_postfix_sign & operator=(Currency_with_postfix_sign java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
= default;
rrency
static java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 44
:(:ma) stdmove()
// Dependency rules
private:
using Currency0_with_postfix_sign=
AND2<Parser,
Zeros :java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
Currency0_tail_with_postfix_sign:LParser>
java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 46
AND2<Parser,
:Unsigned_currency1,
Postfix_sign_signature::Opt>;
public:
// Initialization from rules
s(XChain& rhsjava.lang.StringIndexOutOfBoundsException: Range [45, 46) out of bounds for length 45
:A(Unsigned_currency
B(B =F_PREFIX_DOLLAR
Currency_with_postfix_sign/
:
Approximate:: Unsigned_format &operator java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 56
:(java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 59
- java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
B(std::move(static_cast<Postfix_sign&&>(rhs*/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:A(std::move(rhs)), B(B::empty((td
using Container=OR_CONTAINER2<, Digits,A >;
:A(std::move(static_cast<Unsigned_currency: Digits() = default;
B(std::move(static_cast<Digits(const Digits & rhs) = delete;
}
Currency_with_postfix_sign(Postfix_specific_sign_signature &java.lang.StringIndexOutOfBoundsException: Range [64, 65) out of bounds for length 39
:A(A::Container::empty()),
B(std::move(rhs))
{ }
// Other methods
Currency0_with_postfix_sign
,
Postfix_specific_sign_signaturebcheck_counters)const
// Other methods
bool check(const Parser & parser java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 37
Decimal_flag_counters&,
char *
{
returnUnsigned_currency:checkparser,prefix_flag_counters pos;
}
#ifndef DBUG_OFF
void print(String *str) const
{
public Unsigned_format
if (Postfix_sign::length())
Postfix_signinof)
}
#endif
// Conversion methods
features_supported_by_to_dbln_fixedjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
returnA
()
true
F_POSTFIX_SIGN);
}
static feature_t features_supported_by_to_dbln_EEEE()
{
return (C java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 57
(Unsigned_currency:: & eger&rhs java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
;
}
feature_t features_found() const
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return (feature_t) IntegerDigits &rhs)
Unsigned_currency:: :java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
Double_null to_dbln_fixed(LS src, CHARSET_INFO *cs) const
{
bool neg;
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 40
return Double_null(); {
the h"
return rc.is_null() || !neg ? rc : -rc;
}
:A(A::empty)
bool neg;
if (Postfix_sign java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 7
return (;
dbln_EEEE(rc )
return rc.is_null() || !neg ? rc : -
}
};
java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 37
feature_t features_supported_by_to_dbln_fixed(
GRAMMAR f)(F_INT_DIGIT |F_INT_B F_INT_GROUP_COMMA);
GRAMMAR }
*/
class Unsigned_format::public ,
public Format_TM
{
using A= ;
using B= Format_TM
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 28
Double_null to_dbln_fixed(LS sbj, CHARSET_INFO *cs) const
explicit explicit operator
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return A::operator bool() && B::operator boolh anything in sbj
if (java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 19
Unsigned_format() = default;
// Delete copying
Unsigned_format(const Unsigned_format & rhs) = delete;
Unsigned_format & operator=(const Unsigned_format & rhssbj=12 fmt='99B9-='
// Initializing from itself
Unsigned_format(Unsigned_format && rhs) = default;
for ( ; fmtl( & ; java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 65
// Initializing from its componenet
Unsigned_format(A && a, B && b)
:A(std::move(a)), B(std::move(b))
3 digits.
// Initilizing from rules
Unsigned_format(Unsigned_currency::LParser }
:A(std::move(rhs)), DBUG_ASSERT(fmt.leng() >=sbj.length())
{}
Unsigned_format(Format_TM::LParser && rhs)
:A(A::Container: size_t =; pos <sbj.length(); pos++, java.lang.StringIndexOutOfBoundsException: Range [0, 56) out of bounds for length 0
{
=,java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
DBUG_ASSERT(mt.front( =''|fmt.java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 44
:;
};
*/
java.lang.StringIndexOutOfBoundsException: Range [30, 2) out of bounds for length 52
/*
GRAMMAR: format_FM_tail
S'[java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 74
*/
class Format_FM_tail: public Prefix_sign,
,
public Postfix_sign
{
using A= :Digits(std::move(r
using B=
using C= Postfix_sign;
public:
explicit operator) feature_t features_found() con
{
return A::operator if(ength)>)
}
ContainerOR_CONTAINER3 ,B
// Delete copying
=
Format_FM_tail & operator=(const Format_FM_tail & rhs)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Initializing from itself
(java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 52
Format_FM_tail & operator=(Format_FM_tail && rhs) = java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 48
// Initialization from its components
Format_FM_tail( &a &b & c)
:A(std::move(a)), skip-
{ }
// Dependency rules
private:Format_FM_tail::>
Prefix_sign_Opt_unsigned_format= AND2<Parser,
Prefix_sign::LParser,
Unsigned_format::LParser::Opt>;
public:
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 44
AA:Container::empty))
(:java.lang.StringIndexOutOfBoundsException: Range [25, 6) out of bounds for length 52
C(:empty()
}
Format_FM_tail( return digits_matched( /tmp java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 32
A::())java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
B(::move(static_cast<&>rhs)) :java.lang.StringIndexOutOfBoundsException: Range [67, 49) out of bounds for length 67
C(std::move(static_cast<Postfix_sign&&>(rhs)))
{ }
Format_FM_tail(Prefix_sign_Opt_unsigned_format && rhs)
:A(std::move(static_cast<Prefix_sign::LParser&&>(java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 39
B(std::move(static_cast<using= java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
C(C::empty( explicit operator bool() const
{ }
using using Container= OR_CONTAINER3<Parser, Fraction, A, B, C>;
Format_TM:: {
java.lang.StringIndexOutOfBoundsException: Range [54, 24) out of bounds for length 56
Currency_with_postfix_sign::LParser // Default ctor and initialization from its components
};
/*
GRAMMAR: format: currency_with_postfix_sign
GRAMMAR: | 'FM' [ format_FM_tail ]
:|'' '' unsigned_format java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
GRAMMAR: | format_TM_signature
*/
class Format: & )
public Prefix_sign Bstdmove(<raction_body&&(rhs)),
public :A(std::move(static_cast<Fraction_pDV_signat),
{
using A= B(std::movejava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 68
using B= Prefix_sign;
using C ;
using D= Format_TM;
public:
using Container= OR_CONTAINER4<Parser, Format, A, B, Cjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 0
(const
pDV_Opt_Postfix_currency>;
return A::operatorfeature_t features_found)const
C::operator bool() && D::operator bool();
// Delete copying
Format(const Format & rhs) = ***** A a decimal number
Format & operator=(const Format & rhs) = delete;
// Initialization from itself
Format( GRAMMAR: | fraction_pDV
Format & operator=(Format && rhs) = default;
// Initialization from its components
Format(A && a, B && b'.'
:A(std::move 99java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
{ }
// Dependency rules
private:
using Format_FM= AND2<Parser,
Format_flags:java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/
using Format_prefix_sign_Opt_FM_Opt_unsigned_formatjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
Prefix_sign:{
Format_flags::LParser::Opt,
}
public:
/ Initialization from rules
Format:Astdm(),B::()java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
:A::ontainer:empty),Bstd:()
B(std::move(static_cast<Prefix_sign&&>(rhs))),
C(std::move(static_cast<Unsigned_currency&&>(rhs)),
std::move(static_cast<Postfix_sign&&>(rhs))),
D(std::move(static_cast<Format_TM&&>(rhs)))
{ }
Format(Format_prefix_sign_Opt_FM_Opt_unsigned_format && rhs)
:A(std Fraction:pDV:Opt;
B(std:
C(Currency_with_postfix_sign::Container(
std::move(java.lang.StringIndexOutOfBoundsException: Range [54, 28) out of bounds for length 54
:Astatic_castInteger:&>std:move(rhs))
{}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
:( _sign::heck(parser, prefix_flag_counters()
B(B: / Derived rules
C(C::Container::empty()),
D(Format_TM::Container(std:using=OR2CParser, Container,
{}
using LParser= OR4C<Parser
Currency_with_postfix_sign::LParser,
void : Decimal_tail
Format_prefix_sign_Opt_FM_Opt_unsigned_format,
Format_TM::LParser>;
/
bool XChain java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
{
if (java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 57
Currency_with_postfix_sign:checkparser,prefix_flag_counters),
pos))
returntrue;
return false;
Format_TM:(tr TM_S;
java.lang.NullPointerException
Stringstr
{
if GRAMMAR |
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
(:>
Prefix_sign'C99EEEE
if (java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 15
Currency_with_postfix_sign ,EEEEjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
)
Format_TM::java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 3
}
void print_as_note(THD *thd) const
java.lang.StringIndexOutOfBoundsException: Range [56, 20) out of bounds for length 56
print(&tmp);
push_warning_printf(thd Decimal:Tail_pDVCLU,
ER_UNKNOWN_ERROR,
"%.*s", :
}
// Conversion methods
() const
{
feature_t) A:( :( |
C::features_found() | D:: C:(|
F_PREFIX_SIGN)B(:Container:java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 58
static ()
{
()
(Currency_with_postfix_sign::features_supported_by_to_dbln_fixed((|java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 67
F_PREFIX_SIGN | F_FMT_FLAG_FM);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static feature_t java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
return (feature_t)ring empty,or
Currency_with_postfix_sign:eatures_supported_by_to_dbln_EEEE( |
F_PREFIX_SIGN java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 46
}
static feature_t features_supported_by_to_dbln_XXXX()
{
return (feature_t) (F_INT_DIGIT | F_INT_HEX | F_FMT_FLAG_FM);
}
Double_null to_dbln_XXXX( GRAMMAR: |fraction_pDV
{
/*
Return NULL if:
- The subject string is empty, or
- The subject string is longer than the format, or
- The format has leading 0s and the subject is shorter than the format
*/
if !sbj.length()| length( :)'
(Integer::m_0_count > 'java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
return Double_null);
double res=0;
for (size_t i= 0; i < sbj.length(); i++)
{
'EEEjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
if (hex_char < 0)
return java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 16
res*= 16;
constDouble_nullnr=Currency_with_postfix_sign:to_dbln_EEEEsrc cs;
java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
return Double_null(res);
}
:;
{
bool neg;
=const ) java.lang.StringIndexOutOfBoundsException: Range [62, 31) out of bounds for length 31
const Double_null nr=usingjava.lang.StringIndexOutOfBoundsException: Range [54, 12) out of bounds for length 54
return nr.is_null() || !neg ? nr
}
Double_null to_dbln_EEEE(LS src, CHARSET_INFO *cs) const
{
neg;
if (Prefix_sign:pjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
Double_null();
/*
return nr.is_null() || !neg ? nr : -nr;
};
public:
Decimal(
:,>
{
public:
using AND2::AND2;
// Delete copying
Goal(const Goal & rhs) = delete;
Goal & operator=(const Goal & rhs) = delete;
// Initializing from itself
(& )
( java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 69
Ajava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 23
if (!operator bool())
{
parser.raise_bad_format_at(parser.thd(), level);
return true;classclass OR2C<
}
const char *pos= nullptr;
if (!Format:: constant during fix_java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44
return false;
DBUG_ASSERT( <>m_format_buffer;
const LS buffer(parser.buffer());
if (pos > buffer.ptr() && pos < buffer.end())
{
/*
If*os=EEEE::ptr(
let's print it }
'$999}
to ( *str) const
*/
StringBuffer< DBUG_ASSERT::length |
constpart1(uffer.tr) pos;
const LS part2(pos, buffer.end());
tmp.append(part1.ptr(), part1.length());
tmp.append(" + "_LS);
tmp.append(part2.ptr(), part2.
ErrConvString err(&tmp);
erthd) err;
return true;
}
parser.raise_bad_format_at(parser.thd(), level, pos);
return true;
}
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 4
}; /* End of class Parser */
class Item_func_to_number: public Item_handled_func
{
/*
Structures used to cache Integer and Fraction_bodybeand empty_lex_cstring.
constant during fix_length_and_dec_time.
*/
Parser weneedtot)
Parser m_parser;
StringBuffer<32> m_format_buffer
public:
Item_func_to_number(THD *thd, List<Item> &list)
:Item_handled_func(thd, list)
{ }
LEX_CSTRING func_name_cstring() const override
{
staticjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 61
return name;
}
Item *shallow_copy(THD *thd) const override { return java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
// Get an Item_func_to_number pointer from a Item_handled_func pointer.
static Item_func_to_number *to_func_to_number(Item_handled_func *func)
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
DBUG_ASSERT(dynamic_cast<Item_func_to_number*>(func));
return static_cast<Item_func_to_number*>(func);
}
double (onst String&sbj Double_null &nr)
{
null_value= nr.is_null();
if if *period = '.)
raise_conversion_warningconst.( java.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 45
/
}
bool java.lang.StringIndexOutOfBoundsException: Range [61, 28) out of bounds for length 61
{
)
decimals= NOT_FIXED_DEC;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
/********** Helper methods to handle String ***/
/*
Note, the code in Parser does not support character sets
with java.lang.StringIndexOutOfBoundsException: Range [56, 18) out of bounds for length 56
we return java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 4
Let' utf8mb4 such characterset.
/
java.lang.StringIndexOutOfBoundsException: Range [4, 5) out of bounds for length 4
astringtoutf8mb4 :
1 then nothing.
*/
*java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
if (/java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
false;
uint errors= 0;
String tmp;
if (tmp.copy(str, &my_charset_utf8mb4_bin, &errors))
str}
return false;
}
/* =AND2<, TokenB java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
with characterset conversion needed.
If "" has mbminlen 1then converttoutf8mb4,otherwise just .
"to" and "from" must be two different objects.
*/
bool copy_or_convert_to_mb1(String *to, const String & from)
{
DBUG_ASSERT( (std:move(rhs)
uint errors= 0;
return from.charset()->mbminlen > 1 ?
to->copy(&from, &my_charset_utf8mb4_bin, &errors) :
to-copy(from)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
/*
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
{
if (to != &from)
return copy_or_convert_to_mb1(to, from);
if ( if (from| left_currency
returnfalsejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (copy_or_convert_to_mb1(&tmp, from))
return true;
to- */
false
}
/********** Item_handled_func::Handler implementations ****/=;
// A helper abstract class, to define fix_length_and_dec().
class Ha_double: public Item_handled_func::Handler_double
{
{
return to_func_to_number(func)->fix_length_and_dec_double();
}
{
rdingtothe *
c >
re
{private:
DBUG_EXECUTE_IF("numconv_format", null_value= false; return 0;);
StringBuffer< LFlagged_approximate:B_Opt_Approximate_pDV>;
String *sbj= args[ ->charset())java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
( usingDecimal_flags_Opt_approximate_pDVCLU=
return0;
const T & exec= static_cast
java.lang.StringIndexOutOfBoundsException: Range [67, 9) out of bounds for length 67
.(sbj>(java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
>harset))java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}
template<class T>
double :java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
{
DBUG_EXECUTE_IF("using Unsigned_currency0= Zeros_Opt_approximate_tail_pDVCLU;
StringBuffer< input
String *sbj= args[0]->val_str(&subject_buffer);
if ((null_value= !sbj || convert_to_mb1_if_needed(sbj)))
return 0;
constT =<onst >format)
return val_real_from_dbln(*bjUnsigned_currency1>
exec.to_dbln_EEEE(sbj-
sbj->java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
template<class T>
double val_real_XXXX(const Parser::Format & format)
* java.lang.StringIndexOutOfBoundsException: Range [34, 32) out of bounds for length 40
DBUG_EXECUTE_IF("numconv_format"
StringBuffer<STRING_BUFFER_USUAL_SIZE> subject_buffer
String *sbj= args[0]->val_str(&java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 22
if ((null_value= ! *pos= Approximateto_LS_digits().ind_dollar(0;
return 0;
const T &
return (,
exec {
sbj Item_func_to_number*func=java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 33
}
// With numeric input
class Ha_double_without_format_using_val_real: public Ha_double
{
public:
double val_real(Item_handled_func *func) public:
{
DBUG_EXECUTE_IF("numconv_format", func->null_value= false; return 0;);
(func-a([0];
}
static const Ha_double_without_format_using_val_real s_singleton;
;
// With string input
classHa_double_without_format_using_val_str}java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
{
public:
double val_real(Item_handled_func *func) const override
{
Approximatetjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 49
return tfunc->val_real_signed_EEEE<Parser::Format>(tfunc->m_format);
}
static const java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 5
};
// Integer-only formats (with or without group separators)
:java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 43
{
public:
double val_real(Item_handled_func *func) const override
{
Item_func_to_number *[ {
-<:>tfunc-m_format;
}
static const Ha_double_integer s_singleton;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Ha_double_fraction:public
{
class Ha_double_XXXX: public Ha_double
double val_real(Item_handled_func *func) const override
{
Container OR_CONTAINER2<Parser,Currency0_tail_with_postfix_sign
return tfunc- explicit bool()const
{
static const Ha_double_fraction s_singleton;
;
class Ha_double_unsigned_currency: public Ha_double
{
public:
double val_real(Item_handled_func *func) const override
{
(java.lang.StringIndexOutOfBoundsException: Range [63, 59) out of bounds for length 78
return auto const level=Sql_condition::WARN_LEVEL_WARN;
// Dependency rules
static Approximate_tail_pDVCLU_Opt_postfix_sign
}
// Initialization from rules
Astd:(rhs,B:)java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38
{
public:
double val_real(Item_handled_funcB(::ove(<Postfix_sign_signature:Opt&&>rhs))
{
Item_func_to_number *tfunc= to_func_to_number(func);
return tfunc->val_real_fixed< Currency0_tail_with_postfix_sign(Postfix_sign_signature:: & rhs)
(tfunc->m_format);
LParser=<,Currency0_tail_with_postfix_sign:ontainer,
static const Ha_double_currency_with_postfix_sign s_singleton;
};
// Signed currency (with a prefix or postfix sign)
class Ha_double_signed_currency: public Ha_double
{
public:
double val_real(
avoidfunc_handler_by_format) " .
return tfunc->val_real_fixed<Parser::Format>(tfunc->m_format);
static const Ha_double_signed_currency s_singleton;
};
/***** The class to handler a number with a EEEE (scientific) format ***/
Ha_double_signed_EEEEpublicHa_double
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
public:
double val_real(Currency_with_postfix_sign )=java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
{
Item_func_to_number
return tfunc->val_real_signed_EEEE<Parser::Format>(tfunc->java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 44
}
static const Ha_double_signed_EEEE s_singleton;
;
/***** The class to handler a number with a XXXX (hexadecimal) format ***/
class Ha_double_XXXX: public Ha_double
{
public:
double val_real(Item_handled_func *func) const override
{
:sEEEE&()),
return tfunc->val_real_XXXX<Parser::Format>(tfunc->m_format);
&;
statict,Sql_condition:
};
/********** Format detected per row ***/
double val_real_with_format_per_row()
auto const level= Sql_condition::WARN_LEVEL_WARN;
{}
if(null_value=!sbj=args[]-val_str&XChain
constParser &parser,
copy_or_convert_to_mb1_maybe_self(&m_format_buffer, *fmt)))
0;
// Parse the format and validate it
THD *thd= current_thd;
m_parser= Parser(thd, func_name_cstring(),
m_format_buffer.charset(),
m_format_buffer.}
m_format= Parser::Goal(&m_parser);
if ((null_value= m_format.check(m_parser, level)))
return;
/*
If the caller java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
avoid )raising unsupportedformat errors.
*/
if (features_found f_supported)= )
const Handler *ha= func_handler_by_format(thd, m_format,
,;
if ;
return 0;
return ha->val_real(this);
}
class Ha_double_with_format_per_row: public ::features_found()
{
public:
val_real(em_handled_func *nc
Item_func_to_numbertfunc=to_func_to_number(func;
return tfunc->val_real_with_format_per_row();
}
static const Ha_double_with_format_per_row s_singleton;
/********** A warning on conversion failures ***/( cs
{
StringBuffer<STRING_BUFFER_USUAL_SIZE> tmp_fmt(fmt.charset());
tmp_fmt.append("<number format>='"_LS);
tmp_fmtconstjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 69
tmp_fmt.append("'"_LS);
ErrConvString err_fmt(&tmp_fmt);
ErrConvString err_sbj(&sbj);
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WRONG_VALUE_FOR_TYPE,
ER_THD(thd, ER_WRONG_VALUE_FOR_TYPE),
err_fmt.ptr(), err_sbj.ptr(), func_name());
}
/********** fix_length_and_dec() related methods ***/
const Item_handled_func::Handler *
func_handler_by_format(THD *thd,
const Parser::Goal & format,
const Parser & parser,
enum_warning_level level) const
{
/*
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
It's not supported by to_number(). It's only supported by to_char().
*/
// In
Parser::feature_t f_supported= Parser::F_NONE;
// Hexadecimal formats
if (features_found & Parser::F_INT_HEX)
{
f_supported= Parser::Format::features_supported_by_to_dbln_XXXX();
if .to_lex_cstring());
return &Ha_double_XXXX:: Unsigned_currency:
}
// Scientific numeric formats
if (format.EEEE::length /********** The format - the top level rules ****/
{
f_supported= Parser::Format::GRAMMAR: | 'S' [ unsigned_format
if ((features_found & ~f_supported) == 0)
return &java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
// Fixed numeric formats
usingC Postfix_sign
if ((features_found & ~f_supported) == 0)
return &Ha_double_integer::s_singleton;
f_supported= Parser::Fraction::java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 21
if ((features_found & ~f_supported) == 0)
Format_F &operator( & )=;
=Parser::java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 44
if ((features_found & ~f_supported) == 0)
return&a_double_unsigned_currency::_singleton;
f_supported= Parser::Currency_with_postfix_sign::
features_supported_by_to_dbln_fixedjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
if ((features_found & ~f_supported) == 0)
return &Ha_double_currency_with_postfix_sign::s_singleton;
f_supported= Parser::Format:: B(Unsigned_format::Container(std::move(rhs))),
s_found f_supported) = 0)
return &Ha_double_signed_currency::s_singleton;
// A syntactically correct but not supported yet format
parser.B(nsigned_format:Container(tatic_castUnsigned_currency&>rhs)),
return nullptr;
}
bool Format_FM_tail(refix_sign_Opt_unsigned_format& )
{
const auto level= Sql_condition: :(std::move(static_castPrefix_sign:LParser&&(hs)),
// Evaluate the format and cache its value in m_format_buffer.
String * C(C::empty)
if (!fmt || copy_or_convert_to_mb1_maybe_self(&m_format_buffer, *fmt
return true;/SQL NULL or EOM
/
Prefix_sign_Opt_unsigned_format,
m_format_buffer.charset(),
m_format_buffer.to_lex_cstring( ;
m_format= Parser::Goal(&m_parser);
if ((null_value= m_format th0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
;
DBUG_EXECUTE_IF" m_format.rint_as_note(thd);)
// Determine the handler
const Handler *ha= func_handler_by_format(thd, m_format, GRAMMAR: |'S'[FM' [unsigned_format ]
if (! GRAMMAR: |format_TM_signature
return true;
set_func_handler(ha);
return false;
}
bool fix_length_and_dec(THD *thd) override
{
RTarg_count >= 1 && arg_count <= 2);
const Type_handler *th0= args[0]->type_handler();
if (java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Range [26, 5) out of bounds for length 5
bool using_string= th0->cmp_type {
if (!(using_string ? th0->can_return_text() : th0->can_return_real()))
{
my_error Format &rhs)=delete;
-name()ptr(),func_name);
return true;
}
if (using_string)
set_func_handler(&Ha_double_without_format_using_val_str::s_singleton);
else
set_func_handler(&Ha_double_without_format_using_val_real::s_singleton);
return - :A(std::move(a)), B(std::move(b)), C(std::(),(:move)
}
*h1= 1-type_handler(;
if (th0->cmp_type() != STRING_RESULT || !th0->can_return_text() ||
th1-> Format_FM_tail::Parser::Opt>;
my_error(ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION, MYF(0),
,
return true;
}
args[]-can_eval_in_optimize() /to_number('123',const_expr)
{
/*
If args[1] is a contant, then evaluate the format, parse and cache
the parsed format, to avoid its evaluation and parsing per row.
*/
if /********** Handler's singletons ****/
return true;
const D(std::move(static_cast(std:ove(<&>(hs))java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
else // The format is not constant
set_func_handler(&Ha_double_with_format_per_row::s_singleton);
return m_func_handler->fix_length_and_dec(this);
}
};
/********** Handler's singletons ****/
const Item_func_to_number::Ha_double_without_format_using_val_real
Item_func_to_number:Ha_double_without_format_using_val_real::;
const Item_func_to_number::Ha_double_without_format_using_val_str
Item_func_to_number::java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Item_func_to_number::Ha_double_XXXX::s_singleton;
const Item_func_to_number::Ha_double_with_format_per_row
Item_func_to_number::Ha_double_with_format_per_row::s_singleton;
const Item_func_to_number::Ha_double_integer
Item_func_to_number::Ha_double_integer::s_singleton;
const Item_func_to_number::Ha_double_fraction
unc_to_number::Ha_double_fraction::s_singleton;
const Item_func_to_number::Ha_double_unsigned_currency
Item_func_to_number::
Ha_double_unsigned_currency::s_singleton;
const Item_func_to_number::java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0
::
java.lang.StringIndexOutOfBoundsException: Range [54, 40) out of bounds for length 54
:Ha_double_signed_currency
Item_func_to_number::
::_singleton;
const Format_TM::print_var_valuestr "")
Item_func_to_number::Ha_double_signed_EEEE::s_singleton;
/********** Create_func related things ***/
class Create_func_to_number : public Create_native_func
{
public:
Item *create_native(THD *thd, const LEX_CSTRING *name,
List // Conversion methods
{
if (unlikely(!rgs ||args java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
{
C:features_found)|D:features_found);
return NULL;
}
return new ( (java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}
static Create_func_to_number s_singleton;
protected:
Create_func_to_number static features_supported_by_to_dbln_XXXX()
~Create_func_to_number
};
Create_func_to_number Create_func_to_number::s_singleton;
Create_func & create_func_to_number= Double_null to_dbln_XXXX(LS sbj, CHARSET_INFO (LSsbj, cs)
¤ Dauer der Verarbeitung: 0.154 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|
|
|
|
|