@@ -857,6 +857,14 @@ class ErrBuff
857
857
len= err_conv (err_buffer, (uint) sizeof (err_buffer), str, (uint) len, cs);
858
858
return {err_buffer, len};
859
859
}
860
+ LEX_CSTRING set_strq (const char *str, size_t len, CHARSET_INFO *cs) const
861
+ {
862
+ DBUG_ASSERT (len < UINT_MAX32);
863
+ len= err_conv (err_buffer+1 , (uint) sizeof (err_buffer)-2 , str, (uint) len, cs);
864
+ err_buffer[0 ]= err_buffer[len+1 ]= ' \' ' ;
865
+ err_buffer[len+2 ]= 0 ;
866
+ return {err_buffer, len+2 };
867
+ }
860
868
LEX_CSTRING set_mysql_time (const MYSQL_TIME *ltime) const
861
869
{
862
870
int length= my_TIME_to_str (ltime, err_buffer, AUTO_SEC_PART_DIGITS);
@@ -880,6 +888,7 @@ class ErrConv: public ErrBuff
880
888
881
889
class ErrConvString : public ErrConv
882
890
{
891
+ protected:
883
892
const char *str;
884
893
size_t len;
885
894
CHARSET_INFO *cs;
@@ -896,6 +905,16 @@ class ErrConvString : public ErrConv
896
905
}
897
906
};
898
907
908
+ class ErrConvStringQ : public ErrConvString
909
+ {
910
+ public:
911
+ using ErrConvString::ErrConvString;
912
+ LEX_CSTRING lex_cstring () const override
913
+ {
914
+ return set_strq (str, len, cs);
915
+ }
916
+ };
917
+
899
918
class ErrConvInteger : public ErrConv , public Longlong_hybrid
900
919
{
901
920
public:
0 commit comments